home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
basic
/
qwez40.zip
/
WIND_REZ.DOC
< prev
Wrap
Text File
|
1990-10-30
|
146KB
|
4,224 lines
WINDOWS R-E-Z
VER. 4.00
CONNECT Software
6192 Fawn Meadow
Farmington, NY 14425
Richard Magnanti
(716) 924-3439
CPS: 71020,2040
GENIE: R.MAGNANTI
DELPHI: MAGNANTI
COPYRIGHT (c) 1988, 1989, 1990 BY:
CONNECT Software
ALL RIGHTS RESERVED
CONTENTS
Differences in versions of WINDOWS R-E-Z ----------------- 1
Making executable programs. ( unenhanced PDS version ) --- 2
General overview ( list of procedures included ) ------- 3-5
System and programming requirements ---------------------- 5
Windowing routines ------------------------------------ 6-13
The Active Window ------------------------------- 6
1.00 SETWIND --------------------------------------- 6-7
1.01 MAKEWIND -------------------------------------- 7-8
1.02 CHNGWIND ---------------------------------------- 9
1.03 PRINTW ------------------------------------------ 9
1.04 SAVEWIND ------------------------------------- 9-10
1.05 RESAVE -------------------------------------- 10-11
1.06 RSTRWIND --------------------------------------- 11
1.07 DELWIND ---------------------------------------- 11
1.08 CLRWIND ---------------------------------------- 11
1.09 NEWCOLOR ------------------------------------ 11-12
1.10 LINEW ------------------------------------------ 12
1.11 WINDSTATUS ---------------------------------- 12-13
Pulldown windows ------------------------------------- 14-17
2.00 SETPULL ------------------------------------- 14-15
SETPULL example ----------------------------- 15-16
2.01 PULLDOWN ------------------------------------ 16-17
2.02 CHNGPULL --------------------------------------- 17
Scroll windows --------------------------------------- 18-27
3.00 SCRLWIND ------------------------------------ 18-21
SCRLWIND example ( Auto-exit ) ----------------- 22
SCRLWIND example ( Multiple scroll windows )- 23-26
3.01 MARKED% ------------------------------------- 26-27
Get answer routine ----------------------------------- 28-29
4.00 GETANS -------------------------------------- 28-29
Input routines --------------------------------------- 30-39
5.00 INPTWIND ------------------------------------ 30-32
5.01 SETINPT ------------------------------------- 32-34
SETINPT example ----------------------------- 34-35
5.02 MULTINPT ------------------------------------ 35-38
Editing features for input routines ------------ 39
Directory routines ----------------------------------- 40-43
6.00 GETDISK ---------------------------------------- 40
6.01 FINDPATH --------------------------------------- 40
6.02 SETDISK ------------------------------------- 40-41
Copyright (c) 1988,1989,1990 By: CONNECT Software All Rights reserved.
6.03 DISKSIZE --------------------------------------- 41
6.04 FINDDIR ------------------------------------- 41-43
A directory scroll window ( example ) ------- 44-45
Sound Routine ------------------------------------------- 45
7.00 DOSOUND ---------------------------------------- 45
Program format --------------------------------------- 46-49
Making a customized library -------------------------- 50-51
Description of files --------------------------------- 52-53
Errors ----------------------------------------------- 54-57
Appendix --------------------------------------------- 58-60
Color attribute chart -------------------------------- 58
Multi-field code chart ------------------------------- 59
Border designation chart ----------------------------- 60
Restrictions and disclaimer ----------------------------- 61
Copyright (c) 1988,1989,1990 By: CONNECT Software All Rights reserved.
***************************
* NOTE ------ READ THIS! *
***************************
The information in this documentation refers to the
enhanced version of WINDOWS R-E-Z. Differences between the
QuickBasic ( 4.00, 4.00b and 4.50 ) and the BASIC 7.+ (PDS)
versions are detailed. The documentation can be used for the
unenhanced versions with the following exceptions.
1. MULTI-FIELD INPUT SCREENS - A maximum of 2 input
screens with a maximum of 25 fields per screen are available
in the unenhanced version. This compares to 10 multi-field
screens with up to 100 fields each, in the enhanced version.
2. MEMORY - The code in the unenhanced libraries is not
modular. Therefore executable programs made with the unen-
hanced libraries will contain all of the code even though
all of the procedures are not used. This will substantially
increase the length of any executable file and program.
With the enhanced versions of WINDOWS R-E-Z, it is not
necessary to link modules to executable programs if routines
in a module are not used by the program. Much smaller ex-
ecutable programs are consequently possible.
An additional library is included in the enhanced
versions which does not contain error checking or window
status capability. This library can be used after the
program is de-bugged and also represents an opportunity for
considerable memory reduction.
3. The section labeled "MAKING A CUSTOMIZED LIBRARY"
refers to the enhanced version of WINDOWS R-E-Z.
**********************************************************
** For information on obtaining the enhanced version **
** of WINDOWS R-E-Z see the file ORDER.ME. **
**********************************************************
1
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
*** Making Executable Programs - BASIC 7.0 ***
( UNENHANCED VERSION ONLY )
============================================================
The library in the unenhanced, BASIC 7.+, version of WINDOWS
R-E-Z was made using BASIC 7.1. If you are using BASIC 7.0
the following message will appear when making executable
programs from within the QBX environment.
LINK WARNING L4051: BRT71EFR.LIB: CANNOT FIND LIBRARY
Enter new file spec:
Press ENTER or RETURN. The file, BRT71EFR.LIB, is not
required.
The enhanced version of WINDOWS R-E-Z supplies libraries
for BASIC 7.0 and BASIC 7.1. QuickBasic 4.+ does not
require separate libraries for each version.
============================================================
2
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
*** GENERAL OVERVIEW ***
WINDOWS R-E-Z is a collection of QuickBASIC and assembly
routines which provide users of QuickBASIC ver. 4.00+ and
BASIC 7.0+ ( PDS ) with a complete window management system.
With WINDOWS R-E-Z users can make, save, restore, and delete
up to twenty windows. The memory used to save windowed
areas is dynamically allocated and outside of basic's normal
data storage area leaving more room for the basic programs
data. Windows are assigned a number from zero to twenty.
"INPUT WINDOWS" and "MULTI-FIELD INPUT" routines are
also provided. "INPUT WINDOWS" provide a convenient means
to prompt for, and receive an input. "MULTI-FIELD INPUT"
allows users to define up to 10 input screens, each having up
to 100 input fields. Numerous options are included for
input fields.
WINDOWS R-E-Z provides users the ability to incorporate
"PULLDOWN WINDOWS", emulating those used in the QuickBASIC
programming environment, in their programs.
Directory routines find the default drive and path, disk
size and free space, and directory listing for any path.
File size, date, time, and attributes can also be found.
Several other routines are included which allow the use
of "GET ANSWER WINDOWS" and "SCROLL WINDOWS".
All of the routines require a minimal amount of initial-
ization and the resulting programs present a professional
appearance.
Unlike many other basic "add-ons", WINDOWS R-E-Z
provides extensive error detection and reporting.
Procedures included:
SETWIND -------- Set up routine for windowing procedures.
MAKEWIND ------- Makes a window. Saves windowed area to
window memory. The window becomes the
"active window".
SAVEWIND ------- Saves a screen area to window memory.
RESAVE --------- Saves the active window.
RSTRWIND ------- Restores a window area to the display.
DELWIND -------- Deletes a window area from window memory.
3
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
CHNGWIND ------- Changes the active window to another
window.
NEWCOLOR ------- Changes the print-to color of the active
window for text printed by PRINTW.
The print-to color is used by CLRWIND to
clear the active window's interior.
CLRWIND -------- Clears the interior of the active window.
PRINTW --------- Prints text in the active window using
the window's "print-to" color.
LINEW ---------- Prints a line in the active window using
the window's "print-to" color.
SCRLWIND ------- Places a scrollable list in the active
window.
MARKED% -------- (FUNCTION) Returns position of marked
items after a call to SCRLWIND.
WINDSTATUS ----- Reports window memory status.
SETPULL -------- Set up routine for pulldown windows.
PULLDOWN ------- Makes pulldown windows.
CHNGPULL ------- Changes the color of, and disables or
enables an item in a pulldown window.
INPTWIND ------- Makes an input field with an optional
window. The field can be edited by
the user.
SETINPT -------- Set up routine for multi-field input
screens.
MULTINPT ------- Places input fields on the screen as
defined by a previous call to SETINPT.
GETANS --------- Makes a get answer window or single line
prompt. Waits for a single key response.
DOSOUND -------- Produces sound determined by SETWIND.
GETDISK -------- Returns default disk drive.
4
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
SETDISK -------- Sets the default disk drive.
FINDPATH ------- Returns default path for any drive ( cur-
rent directory ).
DISKSIZE ------- Returns disk size and free space.
FINDDIR -------- Returns directory of any drive or path in
an array.
--------------------------------------------------------
*** SYSTEM AND PROGRAMMING REQUIREMENTS ***
COMPUTER:
IBM PC (XT or AT) or compatible computer. One disk drive.
VIDEO ADAPTER CARD:
MONO, CGA, EGA or VGA emulating CGA.
PROGRAMMING LANGUAGE:
For the QB4.+ version;
QuickBASIC version 4.00 or greater.
- Text mode
For the BASIC 7.+ (PDS) version;
BASIC 7.0 or greater.
- Text mode
- Requires use of "far strings". This is the default
if executable programs are produced from within
QBX. If modules are compiled using BC on the command
line ( outside of the QBX environment ) the /Fs option
must be used.
- Expanded memory arrays are not permitted. If QBX
is started with the /Ea switch these arrays may be
stored in expanded memory.
* - Numeric arrays less than 16k in size.
* - Fixed length string arrays less than 16k in size.
* - User defined type arrays less than 16k in size.
When in doubt, do not use the /Ea switch.
DOS: Version 2.1 or higher.
* Microsoft Basic - BASIC language reference: P 401
-------------------------------------------------------
5
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
USING WINDOWS R-E-Z
THE ACTIVE WINDOW
When a window is defined ( made ) the number assiged to it
by the programmer represents the area covered by the window.
The area is restored or deleted via it's "number". Up to 20
window areas can be saved. The memory used to save the
window areas is automatically managed by WINDOWS R-E-Z.
Any time a window is made it becomes the "active" window. The
active window is used by the following routines.
PRINTW --- Prints text in the active window.
LINEW ---- Prints a line in the active window.
SCRLWIND - Places a scrollable list in the active
window.
CLRWIND -- Clears all text from the interior of the
active window.
RESAVE -- Saves the active window and any text in the
active window.
NEWCOLOR - Changes the "print-to" color of the active
window.
1.00 SETWIND (FAST%, SND%, SHAD%, NOHIFLAG%, ISDOT%)
Description: SETWIND must be called at least once in
any program using the routines in WINDOWS-R-E-Z, prior
to calling any windowing routines. This procedure init-
ializes window memory. It also sets the default window-
ing speed, sound, and window shadow color. In addition
it determines how the pulldown window and scroll window
routines display high intensity characters.
The first call to SETWIND initializes
window memory and sets the default parameters. Subse-
quent calls to SETWIND will not affect window memory but
can be used to change the default parameters.
Arguments: FAST% is used to allow "fast" windowing
if a CGA video card, or emulation, is detected. IF
FAST% = 0 window routines will be slower on computers
with CGA. If FAST% = 1 the window routines will be
"fast" on computers with CGA. This may, however, cause
"snow" with certain CGA cards. If a monochrome card is
detected all windowing is "fast" and FAST% has no
effect.
SND% determines which sound will be
generated by the routines. If SND% = 1 a "CLICK" sound
will be generated. If SND% = 2 will a "BEEP" sound will
be produced. Any other value produces no sound.
6
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
SHAD% sets the color for window shad-
ows. See the color attribute chart for details. Set-
ting SHAD% to 7 works well for monochrome display while
setting SHAD% to 8 works well for color displays.
NOHIFLAG% tells the pulldown and scroll
window routines how to display high intensity "key"
characters. If NOHIFLAG% = 0 and the key character's
color is set to a high intensity it is displayed as high
intensity. If NOHIFLAG% = 1 high intensity "key"
characters are displayed in reverse video. This is
appropriate for LCD displays that can not display high
intensity characters. NOHIFLAG% affects "key" char-
acters only. See PULLDOWN and SCRLWIND descriptions.
ISDOT% sets a period or comma for
the decimal designator. If ISDOT% = 1 the decimal
designator is a period. If ISDOT% <> 1 the decimal
designator is a comma. This is appropriate for some
foreign users.
1.01 MAKEWIND (W%, LABEL$, TR%, LC%, WIDE%, NR%, ATTR%, BORBER%)
Description: Makes a window. May also save a window-
ed area to window memory. The window becomes the active
window. Calls to PRINTW, LINEW, SCRLWIND, CLRWIND,
RESAVE, and NEWCOLOR refer to the active window.
Arguments: W% is the window number and must equal 0 to
20. If W% = 0 the area under the window is not saved.
A window is simply made. If W% is from 1 to 20 the area
under the window is saved and may be restored at a later
time via a call to RSTRWIND. If W% is the number of a
previously saved window area the old window window area
(W%) is deleted and the new window area (W)% is saved.
LABEL$ is the text printed on the top
border or in the title box (see BORDER%) of the window.
By default the print starts on the second column. If
the left character of LABEL$ ="@" the text will be
centered. If LABEL$ is too long it will be truncated to
fit on the top border or in the title box.
TR% is the top row of the window. If TR% =
100 the window will be centered from top to bottom. TR%
can range from 1 to 23 or may equal 100. Any other
value for TR% will result in a error.
LC% is the left column position of the win-
dow. If LC% = 100 the window will be centered from left
to right. LC% can range from 1 to 78 if the display
width is 80 or from 1 to 38 if the display width is 40.
7
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
WIDE% is the window's width. WIDE% must be
greater than 2. WIDE% + LC% -1 must not be greater than
the displays width ( 40 or 80 ).
NR% is the number of rows in the window and
must be greater than 2. NR% + TR% must not be greater
than 26. If NR% is less than 5 a window title box is
not permitted.
ATTR% is the windows colors and may be in
the range of 0 to 255. The foreground ( windows label
and border ) color equals ATTR% MOD 16. The background
color equals INT( ATTR% / 16 ). If the background color
is greater than 7 the foreground flashes and the back-
ground color equals background color - 8. If the fore-
ground and background colors are the same the border and
label will not be visible. ( See the Color Attribute
Chart.) ATTR% becomes the print-to color for window W%.
BORDER% can be up to 3 digits long.
DIGIT = #3 #2 #1
Example = 1 1 1 ( 111 )
Digit #1 sets the border.
0 = No border
1 = Single line border
2 = Double line border
Digit #2 sets the shadow.
0 = No shadow
1 = Right/Bottom shadow
2 = Left/Bottom shadow
3 = Left/Top shadow
4 = Right/top Shadow
Digit #3 set the title box.
0 = No title box
1 = title box *
The example (111) has a 1 for each digit. The window
will has a single lined border, a shadow on the right
and bottom and a title box
* NOTE: If BORDER% is 100 or greater and the number of
rows (NR%) is less than 5 title boxes are not permitted.
( SEE THE BORDER DESIGNATION CHART FOR FURTHER DETAILS.)
8
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
1.02 CHNGWIND (W%)
Description: Makes window (W%) the active window.
W% must represent a window area in window memory.
Argument: W% is the window number. It must range from
0 to 20. If W% does not represent a window saved by a
previous call to MAKEWIND, CHNGWIND reports an error.
NOTE: W% CAN NOT REPRESENT A WINDOW SAVED BY "SAVEWIND".
IT MUST REPRESENT A WINDOW SAVED BY "MAKEWIND".
1.03 PRINTW (TEXT$, R%, LC%)
Description: Prints text to the active window. Care
must be used to assure the active window is visible
as PRINTW will print predicated on the coordinates of
the active window regardless of it's visibility. It is
advisable, therefore, to print to a window immediately
after it is made the active window. The text's color
will be the print-to color of the active window. If
no window is active when PRINTW is called an error will
be reported.
Arguments: TEXT$ is the text to be printed.
R% is the row in the window were the text
will print . If R%=1 the text will print in the first
row below the border or title box. PRINTW may be used to
print a label in the bottom border of the window by
setting R% to the number or rows in the active window
minus 1 ( minus 3 if a title box was specified ). An
invalid value for R% will result in a reported error.
LC% is the left column where TEXT$ starts
printing. If LC%=100 the text will be centered left to
right. IF LC% + the length of TEXT$ is greater than the
windows width (WD%) - 2 an error will be reported.
1.04 SAVEWIND (W%, TR%, LC%, WIDE%, NR%)
Description: Saves a portion of the screen in window
memory. This procedure is the same as MAKEWIND except
no window is made. The area designated by the arguments
is saved. If the number assigned to W% represents a
window area previously saved the old window area is
deleted. If W% was the active window an active window
will no longer exist. An area saved via SAVEWIND can be
"popped" to the screen at appropriate times during
9
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
program execution by RSTRWIND ( see description ).
A screen area saved by SAVEWIND DOES NOT BECOME THE
ACTIVE WINDOW. SAVEWIND differs from RESAVE in that it
saves an area of the screen specified by it's arguments.
RESAVE saves the area of the screen as designated by the
coordinates of the active window.
Arguments: W% must range from 1 to 20.
See MAKEWIND for a description of the
remaining arguments.
1.05 RESAVE
Description: Saves the active window, it's interior,
and shadow. As window number 0 can not be saved the
active window can not be window number 0. If there is
no active window or window number 0 is active when
RESAVE is called an error will be reported.
The screen area saved under the active window is removed
from window memory and replaced with the active window
and it's interior. After complex screens are made in
the active window's interior, RSAVE can be used to save
them. They can be restored to the screen using
RSTRWIND. Use RESAVE immediately after a window is made
and it's interior is filled as RESAVE will save the
area of the screen determined by the active window's
coordinates, even if it is not visible.
Use RESAVE as follows;
1. Make a window number 1 to 20 via a call to MAKEWIND.
This becomes the active window.
2. Print in the window using PRINTW. Additional windows
may also be printed in the window. Use window number
0 to make the additional windows, as the screen area
under them need not be saved.
3. Call CHNGWIND to make the window number used in step
1 the active window. ( Only required if additional
windows were made inside the original window. )
4. Call RESAVE to save active window.
5. Use RSTRWIND to "pop" the window and it's interior on
the screen any time during program execution.
10
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
6. After the window is restored to the screen it may be
printed in again provided it is the active window.
This may require a call to CHNGWIND.
Arguments: None.
1.06 RSTRWIND (W%, DELFLAG%)
Description: Restores a window area previously saved
by MAKEWIND, SAVEWIND or RESAVE. The window area (W%)
must exist in window memory or RSTRWIND does nothing.
Arguments: W% is the number ( 1 to 20 ) assigned to
the saved window area to be restored to the screen. The
window area is returned to it's original coordinates.
DELFLAG% is set to 0 to keep the windowed
area in window memory. If the DELFLAG% is not 0 the
saved window area (W%) is deleted from window memory.
If W% was the active window an active window will no
longer exist.
1.07 DELWIND (W%)
Description: Deletes a saved window area (W%) from
window memory, if it exists in window memory. If the
window is the active window an active window will no
longer exist.
Argument: W% is the window area number.
1.08 CLRWIND
Description: Clears the interior of the active window.
Care must be taken to assure that active window is
visible as CLRWIND clears the area of the screen
designated as the interior of the active window regard-
less of the window's visibility. The window will be
cleared with it's print-to color. If no window is
active when CLRWIND is called, an error is reported.
Arguments: None
1.09 NEWCOLOR ( ATTR% )
Description: Changes the print-to color of the active
window. Text printed in the window by PRINTW or lines
printed in the window by LINEW will assume the new color
11
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
specified by this routine. If the active window is
cleared via a call to CLRWIND, it's interior will be
cleared with the color specified by NEWCOLOR. The color
designation will be retained and used by subsequent
calls to PRINTW or LINEW for the window which was active
when NEWCOLOR was called. If no window is active when
NEWCOLOR is called, an error is reported.
Argument: ATTR% is the new color attribute. SEE THE
COLOR ATTRIBUTE CHART.
1.10 LINEW ( ROW%, TYP% )
Description: Prints, or erases a line in the active
window. If an active window does not exist an error is
reported. The line will assume the print-to color of the
active window. As the border characters are changed
when a line is printed, the color of the border
characters may change also. This will occur if the
print-to color is not the same as the color of the
border characters in the active window.
Arguments: ROW% is the row, of the interior, of the
active window where a line will print. If ROW% < 1 or
ROW% greater then the number of rows in the interior of
the active window an error will be reported.
TYP% is the type of line which will print
and is as follows.
TYP% Line type
1 Single line
2 Double line
0 Erases a line and returns
normal border characters.
Other values Defaults to single line.
NOTE: IF TYP% = 0 ANY TEXT ON THE LINE IN THE WINDOW, AS
DESIGNATED BY THE VALUE OF ROW% WILL BE ERASED.
1.11 WINDSTATUS
Description: This is a programming tool. Calling
WINDSTATUS reports each windows number, top row, left
column, width, number of rows, and attribute (color).
The attribute refers to the original attribute specified
by the call to MAKEWIND for each window. If the
12
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
attribute is "SAVED" the window area was saved by a call
to SAVEWIND, not MAKEWIND. WINDSTATUS also reports the
active window and total window memory used to save
window areas. To use WINDSTATUS place a call to
WINDSTATUS in the program at the location where it is
desireable to view each windows parameters. The program
will terminate and must be restarted. First remove the
call to WINDSTATUS.
Arguments: None.
13
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
***** PULLDOWN WINDOWS *****
These procedures generate a maximum of 10 pulldown windows
with a maximum of 20 items ( lines ) in each window. The
area covered by the pulldown windows is saved and restored
as the window moves from one menubar item to the next.
Unlike the other windowing procedures pulldown windows will
only work in the 80 column display width mode. To select a
menubar item the ARROW keys can be used or the first letter
of the menubar item may be pressed. To select an item from
any of the pulldown windows the ARROW keys, or "KEY CHAR-
ACTER" for the item may be pressed. If the ARROW keys are
used the ENTER or RETURN key must be pressed to finalize the
selection. If a letter is pressed, and it is found, the
procedure is automatically exited without the need to press
the ENTER or RETURN keys. The ESC key always exits.
2.00 SETPULL (BAR$, PWIND$())
Description: Must be called to set up the routine
PULLDOWN. Call SETPULL only once at the beginning of
each program using pulldown windows.
Arguments: BAR$ is the menubar. If BAR$ = "THIS IS A
SAMPLE" the menubar would be; THIS IS A SAMPLE. Two
spaces are placed between each menubar item ( THIS,IS
A,SAMPLE ). The maximum length of the menubar is 80
characters including the spaces. No more than 10 menubar
items are permitted. Error detection checks for the
menubar length and number of items.
PWIND$() is an array that contains all of
the strings representing the items in each pulldown
window. PWIND$() must be in the correct format. ( SEE:
EXAMPLE OF A CALL TO SETPULL ). The last item in each
pulldown window must be followed by a "***" in PWIND$().
"ENDPULL" in PWIND$() marks the end of all pulldown
windows. PWIND$(1) must be the first string in the
array, NOT PWIND$(0).
Each selectable item in PWIND$() has a "KEY CHARACTER".
The key character is the character which is searched for
when a key is pressed while in the PULLDOWN enviornment.
The key character defaults to the first character in
each item. To designate the key character as a
different character follow the character with a "@".
EXAMPLE:
PWIND$(1) = "Get File" ( Key character = "G")
PWIND$(2) = "Save F@ile" ( Key character = "F")
14
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
The "@" will not be displayed when the string is printed
in the pulldown window. The description for KEYATTR%
for the routine PULLDOWN describes how to make the key
character a different color, or high intensity, enabling
users to distinguish it as the key character.
NOTE: DO NOT PLACE THE "@" IN POSITION ONE OR TWO OF THE
STRING AS IT WILL PRINT IN THE PULLDOWN WINDOW. AS
STATED THE KEY CHARACTER WILL DEFAULT TO POSITION ONE IF
THE "@" IS OMITTED FROM THE STRING. THIS ELIMINATES THE
NEED TO PLACE THE "@" IN POSITION TWO.
If an element of PWIND$() = "-" and it is not the first
or last item in a pulldown window it will segment the
pulldown window by placing a line across the width of it.
If the "-" is the first or last item in the pulldown
window it will print as a "-".
EXAMPLE: PWIND$(3) = "-" Providing PWIND$(3) is not
the first or last item in the pulldown window
PWIND$(3) will print as a line across the
window.
--------------------------------------------------------
EXAMPLE OF A CALL TO SETPULL
BAR$ = "THIS IS A SAMPLE" 'MENUBAR STRING DEFINED.
N%=20 'USE THIS METHOD SO
DIM PWIND$(N%) 'PWIND$() IS DYNAMIC.
'DON'T USE DIM PWIND$(20)
TEMP%=0
WHILE PWIND$(TEMP%) <> "ENDPULL"
TEMP% = TEMP% + 1 'TEMP% MUST START WITH 1.
READ PWIND$(TEMP%) 'READ PULLDOWN WINDOW
WEND 'DATA.
CALL SETPULL (BAR$, PWIND$())
ERASE PWIND$ 'COMPLETELY ERASES PWIND$()
'IF IT IS DYNAMIC.
DATA HELLO, JOE,*** :' WINDOW# 1
DATA HOW, ARE, -, YOU,*** :'# 2 LINE IN ROW 3
DATA I,AM@,FINE,*** :'#3., "M" = KEY CHARACTER FOR "AM"
DATA BYE,*** :'#4, ONE ITEM.
DATA ENDPULL
--------------------------------------------------------
15
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
First the menubar is defined, then an array is dimen-
sioned to hold the pulldown window's data. This is only
a temporary array to hold the data and is erased after
SETPULL is called. The data is then read. The "***"
signals the end of each pulldown window and MUST be
entered exactly as shown. The "ENDPULL" signals the end
for all pulldown windows and MUST be the last data item
read. If the format is not exactly as shown an error
will be reported or the windows will not be as expected.
In the example shown the first menubar item is "THIS".
It's associated pulldown window contains the two items
"HELLO" and "JOE". The last menubar item is "SAMPLE"
and it's pulldown window contains one item "BYE".
NOTE: THE DATA MUST BE IN THE FORMAT SHOWN. THE CHAR-
ACTERS "***" MARK THE END OF EACH INDIVIDUAL WINDOW AND
THE WORD "ENDPULL" MARKS THE END OF ALL PULLDOWN WINDOWS.
2.01 PULLDOWN (MENUBAR%, WINDITEM%, ATTR%, KEYATTR%, BORDER%)
Description: Places the menubar on line one. Places
the user in the pulldown window environment.
Arguments: MENUBAR% is the sequential number ( left
to right ) of selected menubar item . It is returned to
the calling procedure (PULLDOWN). If the second item in
the menubar is selected, MENUBAR% will equal two. If the
ESC key is pressed MENUBAR% = 0.
WINDITEM% represents the row number of the selected
pulldown window item. It is returned to the calling
procedure. If the ESC key is pressed WINDITEM% = 0.
NOTE: A LINE IN A PULLDOWN WINDOW OCCUPIES A ROW
POSITION.
ATTR% is the color. It follows the same rules as
described in MAKEWIND except a flashing foreground is
not permitted. Any value over 127 is changed to ATTR%
MOD 128.
KEYATTR% is the color of the key character for each item
in the pulldown windows. If KEYATTR% = 0 the key
character will be the same color as the other characters
in each window item. This would be appropriate if the
first charcter in each item is ALWAYS the key character.
Setting KEYATTR% to a different color, or high intensity,
allows users distinguish the character as the key
16
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
character for each item in the list. Any value for
KEYATTR% over 127 is changed to KEYATTR% MOD 128.
BORDER% is the pulldown window's border designation.
BORDER% can be 0,1,2,10,11 or 12 for pulldown windows.
Any other value for BORDER% will result in an error.
SEE THE BORDER DESIGNATION CHART.
2.02 CHNGPULL ( BARITEM%, WINDITEM%, ATTR% )
Description: Changes the color of an item in a pulldown
window. Also disables or enables the ability to select
the item.
Arguments: BARITEM% is the sequential number ( left
to right ) of the menubar selection associated with the
item's pulldown window.
WINDITEM% is the row position of the item
in the pulldown window's interior.
NOTE: A LINE IN A PULLDOWN WINDOW OCCUPIES A ROW
POSITION.
ATTR% serves two purposes.
If ATTR% > 0 it changes the color of the item
specified by BARITEM% and WINDITEM% to ATTR% ( SEE THE
COLOR ATTRIBUTE CHART ). The key character in the item
also assumes the color specified by ATTR%. The ability
to select the item from the pulldown window is disabled.
Any value for ATTR% over 127 is changed to ATTR% MOD
128.
If ATTR% = 0 the color of the item, and it's key char-
acter is returned to it's original status as defined in
the original call to PULLDOWN. The ability to select
the item is enabled.
17
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
***** SCROLL WINDOWS *****
SCRLWIND places a scrollable list in the active window.
A highlight ( scroll ) bar is placed over a specified item in
the list and can be moved by the user via the UP and DOWN
ARROW keys. Pressing the ENTER key returns the sequential
item number covered by the scroll bar. The HOME, END, PG UP,
and PG DN keys move the scroll bar as indicated. SCRLWIND
searches from the position of the scroll bar to the last item
in the window ( list ) to see if the key pressed is the KEY
CHARACTER of any element of the list. If a match is found the
scroll bar moves to that position in the list.
3.00 SCRLWIND (LIST$(), ENTRIES%, KIND$, RTRN%, KEYATTR%)
Description: Places a list ( LIST$() ) in the active
window. The list is ENTRIES% long.
Arguments: LIST$() is the array holding the strings to
be placed in the scroll window. Each element of the
array is a line in the scroll window. If the length of
any element is greater then the width of the window - 4
an error is reported. LIST$(1) must be the first string
in the array, NOT LIST$(0).
Each selectable item in LIST$() has a "KEY CHARACTER".
The key character is the character which is searched for
when a key is pressed while in the SCRLWIND enviornment.
The key character defaults to the first character in
each item. To designate the key character as a
different character follow the character with a "@" in
the string.
EXAMPLE: LIST$(1) = "Get File" ( Key character = "G")
LIST$(2) = "Save F@ile"( Key character = "F")
The "@" will not be displayed when the string is printed
in the scroll window. The description for KEYATTR% for
this routine describes how to make the key character a
different color, or high intensity, enabling users to
distinguish it as the key character.
NOTE: DO NOT PLACE THE "@" IN POSITION ONE OR TWO OF THE
STRING AS IT WILL PRINT IN THE SCROLL WINDOW. AS STATED
THE KEY CHARACTER WILL DEFAULT TO POSITION ONE IF THE
"@" IS OMITTED FROM THE STRING. THIS ELIMINATES THE
NEED TO PLACE THE "@" IN POSITION TWO.
18
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
If an element of LIST$() = "-" and it is not the first
item in the list or the last item in the list and all of
the items in LIST$() will fit in the window's interior
the scroll window will be segmented. A line will print
across the window as determined by the position of the
"-" in LIST$(). If the previous conditions are not met
the string will print as a "-".
EXAMPLE: LIST$(2) = "-" ( Provided LIST$(2) is not
the last item in the list and the number of
interior rows in the window is greater than
two, LIST$(2) will print as a line.)
ENTRIES% is the number of elements in the
array ( LIST$() ) to use in the scroll window .
KIND$ is as follows;
IF KIND$ = "A" when entering SCRLWIND the scroll window
is an "AUTO-EXIT" scroll window. If the key pressed
equals the key character of an item in the scroll window
and the item is between the scroll bar and the end of the
list the routine will automatically exit. The position
of the selected item in LIST$() will be returned in
RTRN%. If RTRN% = 2, LIST$(2) was selected.
IF KIND$ ="M" when entering SCRLWIND the scroll window is
a "MARK" scroll window. Pressing the <+> or INSERT key
marks the item covered by the scroll bar. A right arrow
is printed to the left of the item in the scroll window
to signify it has been marked. Pressing the <-> or
DELETE key un-marks an item if it was marked. Striking
the PRINT key or space bar marks all items, unless they
were all previously marked, in which case the PRINT key
or space bar will unmark all items. Pressing the ENTER
or RETURN key returns a coded string in KIND$ which
represents the marked items. If KIND$ ="" no items were
marked. If any items were marked KIND$ will be ENTRIES%
long. Each character in KIND$ will correspond to an
element in LIST$(). If the first character of KIND$=" "
then LIST$(1) was not marked. If the second character
in KIND$ = CHR$(26) then LIST$(2) was marked. Each un-
marked element of LIST$() will have a corresponding space
( " " ) in KIND$ while each marked element will have a
corresponding right arrow ( CHR$(26) ) in KIND$. See the
description for the function MARKED% for a method of
decoding KIND$.
IF KIND$ = "S" when entering SCRLWIND the scroll window
is a "SINGLE MARK" scroll window. Provided there is more
than one item ( ENTRIES% > 1 ) in the scroll window, one
item will be marked as in the preceding example for a
19
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
"MARK" scroll window. Only one item can be marked,
however. The marked item follows the scroll bar.
Pressing TAB, ENTER, RETURN or ECS will exit the scroll
window. If TAB, ENTER or RETURN is pressed the selected
item number is returned in RTRN%. If the scroll bar is
over LIST$(2), RTRN% = 2. If ESC is pressed RTRN% = 0.
SINGLE MARK scroll windows with one entry ( ENTRIES%=1 )
do not mark the item. RTRN% = 1 if ENTER or RETURN is
pressed. RTRN% = 0 if ESC is pressed and RTRN% = -1 if
TAB is pressed. These scroll windows can be used as
<OK>, <CANCEL>, <ABORT> etc... scroll windows.
NOTE: SEE THE SECTION LABELED "Multiple Scroll Windows"
TO SEE HOW SINGLE MARK SCROLL WINDOWS CAN BE USED TO
DISPLAY AND USE SEVERAL SCROLL WINDOWS AT ONE TIME.
IF KIND$ = "V" the scroll window is "VIEW ONLY". The
window will be filled with the strings in LIST$() and the
routine will be exited.
IF KIND$ = "SV" the scroll window is "VIEW ONLY - SINGLE
MARK" scroll window. The window will be filled with the
strings in LIST$(). If ENTRIES% > 1 the item designated
by the value of RTRN% will be marked. ( See description
for RTRN%. )
Any other value for KIND$ when entering SCRLWIND results
in a "REGULAR" scroll window. After the scroll bar
is moved to the selected item, pressing the ENTER or
RETURN key returns the selected item in RTRN%.
RTRN% serves two purposes. One is to place
the scroll bar over a the item specified by RTRN% when
entering SCRLWIND. If RTRN% < 1 or RTRN% > ENTRIES%,
RTRN% defaults to 1 and the scroll bar will be positioned
over the first item in the window.
EXAMPLE: RTRN% = 2 ( If there are a minimum of two
items in the scroll window ( ENTRIES% > 1 ) the scroll
bar will be over LIST$(2) when entering SCRLWIND. )
RTRN% also returns the selected item when exiting
SCRLWIND. If RTRN% = 2, LIST$(2) was selected. IF ECS
is pressed to exit SCRLWIND, RTRN% = 0. If TAB is
pressed and the scroll window is a "SINGLE MARK" scroll
window with over one entry, RTRN% returns the selected
item. If the scroll window is a "SINGLE MARK" scroll
window with one entry and TAB is pressed, RTRN% = -1.
20
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
NOTE: THE ITEM SELECTED IN LIST$() ( AS INDICTED BY THE
VALUE OF RTRN% ) MAY CONTAIN A "@" TO INDICATE THE KEY
CHARACTER. IF IT IS NESESSARY TO PRINT THE ITEM THE "@"
CAN BE REMOVED FROM IT USING THE FOLLOWING FUNCTION.
' FUNCTIONS MUST BE DECLARED. RTRN% = ITEM # SELECTED
' FROM LIST$().
DECLARE FUNCTION NO$( ITEM$ )
'( Place this at the start of the module.)
' IF RTRN% = 2 AND LIST$(RTRN%) = "Save F@ile", LIST$(2)
' CAN BE PRINTED AS "Save File" as follows.
PRINT NO$( LIST$(RTRN%) )
' INCLUDE THIS FUNCTION IN YOUR PROGRAM
FUNCTION NO$ ( ITEM$ )
A% = INSTR ( ITEM$, "@" )
IF A% < 3 THEN '"@" SHOULD NOT BE IN POSITION
NO$ = ITEM$ ' 1 OR 2, OR NO "@" IN ITEM$.
ELSE
NO$ = LEFT$(ITEM$, A% - 1) + MID$(ITEM$, A% + 1)
END IF
END FUNCTION
KEYATTR% is the color of the key character
for each item in the scroll window. If KEYATTR% = 0
the key character will be the same color as the other
characters for each window item. This would be
appropriate if the first charcter in each item is ALWAYS
the key character. Setting KEYATTR% to a different
color, or high intensity, allows users to distinguish the
character as the the key character for each item in the
list. KEYATTR% has no effect on the background color of
an item when it is covered by the scroll bar. It can
effect the background color for the key character. This
is useful for computers without high intensity or color
capabilities.
21
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
-------------------------------------------------------
'EXAMPLE OF A CALL TO SCRLWIND - AUTO EXIT SCROLL WINDOW
DIM LIST$(11)
FOR X% = 1 TO 11 'ALWAYS START WITH 1
READ LIST$(X%)
NEXT
CALL MAKEWIND(15, "", 1, 1, 10, 13, 112, 2)
KIND$ = "A" : RTRN% = 3: KEYATTR% = 116
CALL SCRLWIND(LIST$(), 11, KIND$, RTRN%, KEYATTR%)
DATA ONE
DATA TW@O
' FOR ABOVE KEY CHAR. = "W"
DATA TH@REE
' FOR ABOVE KEY CHAR. = "H"
DATA FOUR
DATA FIV@E
' FOR ABOVE KEY CHAR. = "V"
DATA "-"
' FOR ABOVE PUT A LINE IN ROW 6
DATA SIX@
' FOR ABOVE KEY CHAR. = "X"
DATA SEVEN
DATA EIGHT
DATA NINE
DATA TEN
-------------------------------------------------------
The scroll window is the window defined by the call to
MAKEWIND as it is the active window when SCRLWIND is
called. The list in the scroll window is the items in
the data statements, as they were read into LIST$().
The second parameter in the call to SCRLWIND is the
number of items in the list ( 11 ). As KIND$ ="A"
before calling SCRLWIND, the scroll window is an "AUTO-
EXIT SCROLL" window. Since RTRN% = 3 when entering
SCRLWIND the scroll bar will start over the third item (
THREE ). The sixth DATA item = "-". Therefore, a line
will print in row six of the scroll window. The key
character for each item will be red ( KEYATTR% = 116 ).
RTRN% will equal the selected item when SCRLWIND is
exited. As reading the data takes time, quicker scroll
windows will be generated if all arrays used in scroll
windows are filled using READ and DATA statement during
program initialization.
22
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
-------------------------------------------------------
' EXAMPLE - MULTIPLE SCROLL WINDOWS ( SINGLE MARK )
' FIRST INITIALIZE THE DATA FOR THE SCROLL WINDOWS. DO
' THIS AT THE BEGINNING OF THE PROGRAM FOR SPEED.
DIM SWIND%(5), STR%(5), SLC%(5), SWID%(5), SNR%(5)
DIM SENTRIES%(5), STITLE$(5)
DIM SRTRN1$(4), SRTRN2$(5), SRTRN3$(4)
DIM SRTRN4$(1), SRTRN5$(1)
FOR X% = 1 TO 5 ' DATA FOR 5 SCROLL WINDOWS
READ SWIND%(X%) ' WINDOW # FOR EACH SCROLL WINDOW
READ STR%(X%) ' TOP ROW
READ SLC%(X%) ' LEFT COLUMN
READ SWID%(X%) ' WIDTH
READ SNR%(X%) ' NUMBER OF ROWS
READ SENTRIES%(X%) ' ENTRIES
READ STITLE$(X%) ' TITLE ( FOR WINDOWS TITLE BOX )
FOR Y% = 1 TO SENTRIES%(X%)
SELECT CASE X% ' X% = WINDOW #
CASE 1
READ SRTRN1$(Y%) ' LIST FOR SCROLL WINDOW 1.
CASE 2
READ SRTRN2$(Y%) ' LIST FOR SCROLL WINDOW 2.
CASE 3
READ SRTRN3$(Y%) ' LIST FOR SCROLL WINDOW 3.
CASE 4
READ SRTRN4$(Y%) ' LIST FOR SCROLL WINDOW 4.
CASE 5
READ SRTRN5$(Y%) ' LIST FOR SCROLL WINDOW 5.
END SELECT
NEXT
NEXT
' DATA FOR EACH SCROLL WINDOW
' WINDOW#, TOP ROW,LEFT COLUMN,WIDTH,ROWS,ENTRIES,TITLE,
' ITEMS IN THE LIST
DATA 16,5,16,12,8,4," TYPE",COLONIAL,SPLIT,BI-LEVEL,RANCH
DATA 17,5,35,12,9,5," COLOR",WHITE,BLUE,TAN,BROWN,YELLOW
DATA 18,5,54,12,8,4," LOCATION",NORTH,SOUTH,EAST,WEST
DATA 19,14,24,14,3,1,"","----OK----"
DATA 20,14,43,14,3,1,"","--CANCEL--"
23
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
' MARK THE FIRST ITEM IN EACH SCROLL WINDOW. CAN BE
' USED FOR ANY ITEM IN THE WINDOW.
SRTRN1% = 1: SRTRN2% = 1: SRTRN3% =1
' ******* LATER IN THE PROGRAM DO THIS:
' USE THE PREVIOUS DATA FOR THE MULTIPLE SCROLL
' WINDOWS.
' SAVE THE VALUES FOR THE MARKED ITEM IN EACH SCROLL
' WINDOW. NEEDED FOR ESC OR --CANCEL-- .
PRTRN1% = SRTRN1%: PRTRN2% = SRTRN2%: PRTRN3% = SRTRN3%
' MAKE FIVE WINDOWS. WINDOW NUMBERS 16 - 20 ( SWIND%() ).
' AS BORDER% MOD 100 = 0 THERE IS NO BORDER -- BE
' CAREFULL AS THE BLANK BORDER STILL OCCUPIES A POSITION
' ON THE SCREEN.
' AS THE BORDER (BRDR%) ARGUMENT =100 FOR WINDOWS 16, 17
' AND 18 THOSE WINDOWS HAVE A TITLE BOX. THE "OK" AND
' AND "CANCEL" SCROLL WINDOWS HAVE LESS THAN 5 ROWS SO
' THEY CAN'T HAVE NO TITLE BOX, THUS BRDR% IS SET TO 0.
' SINCE THE ARGUMENT FOR COLOR = 112 THE BACKGROUND
' COLOR WILL BE WHITE WITH A BLACK FOREGROUND.
' **** SUGGESTION: WHILE DEVELOPING MULTIPLE SCROLL
' WINDOWS SET THE BORDER TO PRINT. THIS WILL GIVE A
' BETTER PICTURE AS TO HOW BIG THE WINDOWS ARE. AFTER
' DEVELOPMENT THE BORDER CAN BE SET BLANK ( 100 OR 0 ).
FOR X% = 1 TO 5
' BORDER IS TITLE BOX EXCEPT WINDOW 19 & 20
IF SWIND%(X%) > 18 THEN BRDR%=0 ELSE BRDR%=100
'PUT THE FOLLOWING CALL TO MAKEWIND ON ONE LINE.
CALL MAKEWIND (SWIND%(X%), STITLE$(X%), STR%(X%),
SLC%(X%), SWID%(X%), SNR%(X%), 112, BRDR%)
NEXT
KIND$ = "SV" ' THIS MAKES THE SCROLL WINDOWS "SINGLE
' MARK - VIEW" SCROLL WINDOWS FOR THE
' FIRST PASS THROUGH THEM. THE ITEMS IN
' THE LIST FOR EACH SCROLL WINDOW WILL
' PRINT IN THE WINDOW AND SCRLWIND WILL BE
' EXITED. AFTER ALL FIVE WINDOWS ARE
' FILLED KIND$ IS SET TO "S" AND THE FIRST
' SCROLL WINDOW BECOMES ACTIVE. A USER
' ACTION IS THEN REQUIRED.
24
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
' FILL THE SCROLL WINDOWS FIRST, THEN GO BACK TO THE
' FIRST ONE ( WINDOW # 16 ). LAST ARGUMENT = 0 SO THE
' KEY CHARACTER IS THE SAME COLOR ( BLACK ON WHITE ) AS ALL '
OTHER CHARACTERS. THE KEY CHARACTER IN THIS EXAMPLE IS '
ALWAYS THE FIRST CHARACTER.
STARTS:
' SCROLL WINDOW TITLED "TYPE"
CALL CHNGWIND (16) ' MAKE 16 THE ACTIVE WINDOW
CALL SCRLWIND (SRTRN1$(), SENTRIES%(1), KIND$, SRTRN1%, 0)
IF SRTRN1% = 0 GOTO NOCHANGE ' ESC
' SCROLL WINDOW TITLED "COLOR"
CALL CHNGWIND (17)
CALL SCRLWIND (SRTRN2$(), SENTRIES%(2), KIND$, SRTRN2%, 0)
IF SRTRN2% = 0 GOTO NOCHANGE ' ESC
' SCROLL WINDOW TITLED "LOCATION"
CALL CHNGWIND (18)
CALL SCRLWIND (SRTRN3$(), SENTRIES%(3), KIND$, SRTRN3%, 0)
IF SRTRN3% = 0 GOTO NOCHANGE ' ESC
' "OK" SCROLL WINDOW. SINGLE ENTRY SO NO ITEMS ARE MARKED.
CALL CHNGWIND (19)
CALL SCRLWIND (SRTRN4$(), SENTRIES%(4), KIND$, TEMP%, 0)
IF TEMP% = 0 GOTO NOCHANGE ' ESC
IF KIND$ = "S" THEN ' WAS NOT "SV" ( VIEW )
IF TEMP% = 1 GOTO PROCEED ' WAS ENTER OR RETURN
IF TEMP% = 0 GOTO NOCHANGE ' WAS ESC
END IF
' "CANCEL" SCROLL WINDOW. SINGLE ENTRY SO NO ITEMS ARE MARKED.
CALL CHNGWIND (20)
CALL SCRLWIND (SRTRN5$(), SENTRIES%(5), KIND$, TEMP%, 0)
IF KIND$ = "SV" THEN ' DONE DISPLAYING WINDOWS SO
KIND$ = "S" ' MAKE "SINGLE MARK" SCROLL
GOTO STARTS ' WINDOWS AND START OVER.
END IF
IF TEMP% = - 1 GOTO STARTS ' FOR SINGLE ENTRY SCROLL
' WINDOWS TEMP% = -1 FOR TAB.
' PROGRAM PROCEEDS HERE IF TAB WAS NOT PRESSED FOR
' "CANCEL" SCROLL WINDOW. ENTER, RETURN OR ESC MUST HAVE
' BEEN PRESSED. PROGRAM GOES TO NOCHANGE TO RESTORE VALUES
NOCHANGE:
' ESC OR CANCEL SELECTED. RESTORE PREVIOUSLY SAVED VALUES.
SRTRN1% = PRTRN1%: SRTRN2% = PRTRN2%: SRTRN3% = PRTRN3%
25
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
PROCEED:
' IF ENTER OR RETURN WAS PRESSED WITH THE "OK" SCROLL '
WINDOW ACTIVE SRTRN1%, SRTRN2%, AND SRTRN3% NOW HOLD THE '
MARKED ITEMS FOR THEIR RESPECTIVE SCROLL WINDOWS. IF ESC '
OR "CANCEL" WAS SELECTED THE PROGRAM GOES TO NOCHANGE AND '
SRTRN1%, SRTRN2%, AND SRTRN3% ARE LOADED WITH THEIR OLD '
VALUES
3.01 MARKED%(RTRN$, START%)
Description: MARKED%(RTRN$, START%) is a function used
to decode RTRN$ after a call to SCRLWIND is made with
the MARK option ON. MARKED%(RTRN$, START%) will equal
the next position in RTRN$ starting from position START%
which contains a CHR$(26). If the third element (item)
in LIST$() was marked in the call to SCRLWIND and START%
=1, THEN: MARKED%(RTRN$,START%) = 3.
Arguments: RTRN$ is the string returned by calling
SCRLWIND with the MARKED option ON. RTRN$ = "" if no
items were marked.
START% is the postion in RTRN$ to start
searching for a CHR$(26). A CHR$(26) in RTRN$
represents a marked element in the string array LIST$()
used in SCRLWIND. Every time a position in RTRN$ is
found which corresponds to a marked element of LIST$(),
START% is set to a new value which is equal to the
"marked" position in RTRN$ + 1. This is the next
position in RTRN$ where the search will start for
another "marked" position. If MARKED% =0 there are no
more "marked" positions in RTRN$ or RTRN$ = "".
-------------------------------------------------------
'EXAMPLE USING THE FUNCTION MARKED% (RTRN$,START%) THIS
'EXAMPLE PRINTS THE MARKED ITEMS IN LIST$() AFTER A CALL
'TO SCRWIND.
'GIVEN: SCRLWIND HAS BEEN CALLED. THE FOURTH AND TENTH
'ELEMENTS OF LIST$() WERE MARKED. RTRN$ WAS RETURNED BY
'A PREVIOUS THE CALL TO SCRLWIND.
DECLARE FUNCTION MARKED%(RTRN$,START%) ' MUST BE IN
'(Put this at the start of the module) ' MODULE USING
' FUNC. MARKED%.
START%=1 ' START THE SEARCH AT POSITION 1
' OF RTRN$.
26
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
DO ' MARKED% = 0 AFTER
A% = MARKED%(RTRN$, START%) ' ALL MARKED ITEMS
IF A% = 0 THEN EXIT DO ' ARE FOUND OR IF
PRINT LIST$(A%)
END IF
LOOP
-------------------------------------------------------
The first time through the loop, MARKED% (RTRN$, START%)
will equal 4, and LIST$(4) will print. START% is auto-
matically set to 5, the next position to start searching
RTRN$ for a "marked" position in RTRN$. The second loop
will set MARKED% (RTRN$,START%) to 10 and LIST$(10) will
print. As there are no more marked positions, MARKED% =
0 and the loop be exited.
27
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
***** GET ANSWER WINDOWS *****
Get answer pauses the program, prompts the user, and waits
for the user to press a key. The prompt may, optionally, be
windowed. The key may be any key, or individual keys from a
list of permissible keys. The area covered by the get answer
window is restored after the key is pressed.
4.00 GETANS (PROMPT$, CHOICE$, ANS$, TR%, LC%, ATTR%, BORDER%)
Description: Generates a prompt with an optional window
and pauses, waiting for a reply.
Arguments: PROMPT$ is the prompt (i.e. Press any key )
or question (i.e. Are you sure? Y/N ). It may be
optionally windowed ( SEE BORDER% ). The width of the
window is determined by the length of PROMPT$. If
PROMPT$ is too long making the window, or prompt, too
wide to fit on the screen an error will be reported.
CHOICE$ is the valid keys the user can
press to exit GETANS. If CHOICE$ = "" any key will
exit. This would be appropriate if PROMPT$ = "Press any
key". If CHOICE$ = "YN" then the "Y" or "y" or "N" or
"n" keys will exit GETANS. The ESC key will always exit
regardless of CHOICE$.
ANS$ is the key pressed. It is returned in
upper case. If CHOICE$ = "" then ANS$ = "". If ESC is
pressed CHR$(27) is always returned in ANS$.
TR% is the top row. See MAKEWIND
LC% is the left column. See MAKEWIND
ATTR% is the color designation. See
MAKEWIND. Although it is permissible to set ATTR% > 127
to make the border flash the text will not flash.
BORDER% is the window's border designation.
Title boxes ( BORDER% > 42 ) are not permitted. Set
BORDER% to 0 for no window ( prompt only ). SEE THE
BORDER DESIGNATION CHART.
EXAMPLE OF A CALL TO GETANS:
CALL GETANS ("Are you sure? Y/N", "YN", ANS$, 100, 100,
240, 11)
( Above must be on one line. )
28
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
A window will be generated with the text "Are you sure?
Y/N" printed in it. With TR% and LC% set to 100 the
window will be centered on the screen ( See MAKEWIND ).
ATTR% = 240, therefore, the window will be white with
black text and a black flashing border. The user may
press the N, n, Y, y, or ESC keys to exit. The key
pressed will be returned to GETANS in the argument ANS$.
29
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
***** INPUT ROUTINES *****
Input routines provide users with the ability to generate a
single input field ( INPTWIND ), or multiple input fields
( MULTINPT ). Full editing is provided within each field.
Up to 10 multiple input screens may be used, with each screen
capable of supporting up to 100 fields. Fields may be defined
as numeric, alpha/numeric, or date. Numeric fields may be
designated 0 to 6 decimal places and optionally padded with
leading zero's. Numerous additional options are available.
5.00 INPTWIND (PROMPT$,CODE$,TR%,LC%,WD%,ATTR%,RES$,RTRN$,BORDER%)
Description: Makes an input field, which may optionally
be windowed. The area under the field or window is auto-
matically saved. It is restored upon exiting the routine.
Arguments: PROMPT$ is the message which will be
printed to the left of the input field or in the title
box of the window, if one is specified. If PROMPT$ is
preceded by a "@" it will be centered in the title box.
CODE$ sets the type of input field and may
may equal the following:
"A" - Alpha/numeric. All standard keys are
active.
"U" - Alpha/numeric. Upper case.
"L" - Alpha/numeric. Lower case.
"D" - Date. If a field is a date field it can
not be exited unless the date is valid or
the field is blank. The number keys, "/"
and "-" are active. Valid dates range
from 1/1/1980 to 12/31/2099.
"P0" or "0" - Numeric. The value of the string desig-
"P1" or "1" nates the number of decimal places that
"P2" or "2" will be returned, even if more are
"P3" or "3" entered. The field can not be exited
"P4" or "4" unless the number, with the correct
"P5" or "5" number of decimal places will fit in the
"P6" or "6" the field. or the field is blank. The
numeric,"-", and "." keys are active.
The minus sign will only print in the
first position of the field. If a
decimal point is in the field another one
can not be entered until the previous one
is deleted.
30
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
NOTE: A numeric field will be padded with leading zeros
if CODE$ contains a "P."
EXAMPLE: CODE$ = "3P" --- This allows numeric
input. It will return the data expanded,
or truncated to, 3 digits after the dec-
imal point and padded with leading zeros.
TR% is the top row of the field, or window.
If a window is designated, TR% must equal 1 to 23.
Without a window TR% must equal 1 to 25. Setting TR%
to 100 centers the field, or window, top to bottom.
LC% is the left column. If a window is
designated, LC% must equal 1 to 76 ( 36 in 40 column
mode ). With no window LC% must equal 1 to 79 ( 39 in
40 column mode ). If LC% = 100 the field, or window, is
centered left to right. If LC% is set so the input
field with a window, if specified, or with a prompt, if
specified, will not fit on the screen an error will be
reported.
WD% is the fields width. A date field must
have WD%=10 or WD%=8. A numeric field requires WD% to
be from the number of ( decimal places + 1 ) to 15, and
for an alpha/numeric field WD% can range from 1 to the
screen width minus 1 ( minus 4 if windowed ).
ATTR% is the window's and PROMPT$'s color.
The color of the input field is the inverse of the
window's color. The field's foreground color is the
same as the window's background color while the field's
background has the same color as the windows foreground.
SEE THE COLOR ATTRIBUTE CAHRT. To make the field's
foreground color high intensity, add 1000 to ATTR%.
EXAMPLE: ATTR% = 1160. ( 1000 + 160 ) The "160"
produces a flashing black on green window. ( SEE THE
COLOR ATTRIBUTE CHART. ). The "1000" makes the field
text high intensity green.
RES$ is the restrict string. It holds the
allowable characters which can be entered in the input
field. RES$ IS IGNORED IF CODE$ IS NOT ALPHA/NUMERIC
("A"). IF CODE$ IS ALPHA/NUMERIC ("A") AND RES$ = ""
ALL STANDARD ALPHA/NUMERIC KEYS ARE ALLOWABLE. (SEE
SETINPT IN SECTION 5.01 FOR DETAILS.)
31
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
RTRN$ is the string passed to, and returned
from the input field. A numeric string can be converted
to a number by using the VAL function.
EXAMPLE: IF RTRN$= "123.123" IT CAN BE CONVERTED TO A
NUMBER (A) WITH THE STATEMENT:
A = VAL(RTRN$)
A now equals 123.123
BORDER% is the input windows border. ( SEE
THE BORDER DESIGNATION CHART ). If BORDER% = 0 a single
line input field ( no window ) is generated. If BORDER%
produces a title box window, PROMPT$ will printed in the
title box.
5.01 SETINPT ( SCRN%, COLWID%, EXIT$, INPT%(), INPT$(), ACTCOL% )
Description: Defines a multi-field input screen, which
will be called by MULTINPT.
Arguments: SCRN% is the number or the screen being
defined. SCRN% may range from 1 to 10.
COLWID% is the column width of the screen
and must equal 40 or 80.
EXIT$ is the code for keys which will
exit the multi-field input routine for the designated
screen number. To make the function keys active place
their number "1","2" etc in EXIT$. A "0" represents
the F10 key, a "D" the PGDN key and a "U" the PGUP key.
EXAMPLE: IF EXIT$ ="03U" THE F10, F3, OR PGUP KEYS WILL
EXIT THE ROUTINE.
INPT%() and INPT$() hold the data
representing the parameters for each field in the multi-
field input screen. Starting at INPT%(1) and INPT$(1),
INPT%() AND INPT$() are as follows;
------------ INPT%() ---------- -INPT$()-
1 2 3 4 5 6 1
(Field #1) CODE%, TR%, LC%, WD%, ATTR%, 99, RES$
(Field #2) ...... Repeat above for each field
9999 ( signals end of INPT%()/INPT$() )
32
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
INPT%(1)=CODE% FOR FIELD 1, INPT%(7)=CODE% FOR FIELD 2
INPT$(1)=RES$ FOR FIELD 2, INPT$(2)=RES$ FOR FIELD 2
CODE% is the code for type of input field
and can be as follows;
0 to 6 ----- The field is numeric with the indicated
number of decimal places.
10 to 16 --- The field is numeric with padded zeros.
Subtract 10 to obtain the number of decimal places.
7 ---------- The field is alpha/numeric.
8 ---------- The field is a date field.
17 --------- The field is alpha/numeric. (upper case)
27 --------- The field is alpha/numeric. (lower case)
Adding 100 to CODE% makes the field protected. A
protected field will be displayed but can not be
edited. A protected field can not be an Auto-advance
or Auto-exit field. If a protected field is defined as
an Auto-exit or Auto-advance field the definition is
ignored and the field remains a protected field.
Adding 1000 to CODE% makes the field an Auto-advance
field. When the cursor reaches the end of an Auto-
advance field, via typing a character, it moves to the
next field. ( User defined order. )
Adding 10000 to CODE% makes the field an "Auto-exit
always" field. The multi-field input routine will be
exited whenever the cursor is moved from an "Auto-exit
always" field or .....
Adding 20000 to CODE% makes the field an "Auto-exit on
change" field. The multi-field input routine will be
exited only when the data in the field is changed.
This is useful if a field is part of a formula to
calculate another fields value.
EXAMPLE: If CODE%= 21027 THEN CODE% = 20000+1000+27.
THE FIELD IS ALPHA/NUMERIC ( UPPER CASE ), AUTO-ADVANCE
AND "AUTO-EXIT ON CHANGE".
** SEE THE MULTI-FIELD CODE CHART IN THE APPENDIX.**
TR%, LC%, and WD% are the same as in
INPTWIND.
33
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
ATTR% is the fields color.
99 is a check and must follow the numeric
data which defines each field.
RES$ defines the allowable characters
in a restricted field. If the field is not set to
alpha/numeric by CODE%, RES$ is ignored. Setting RES$ to
"YN" and CODE% TO 17 ( UPPER CASE ) allows the field to
respond to Y,y,N or n. If CODE% = 7 ( UPPER AND LOWER
CASE ) and RES$ ="YN" the field is restricted to Y or N.
IF CODE%=27 ( LOWER CASE ) and RES$ ="YN" the field will
not allow any characters. If RES$ = "" the field is not
restricted and will respond to characters predicated on
the value of CODE%.
NOTE: IT IS ONLY NECESSARY TO USE RES$ FOR NON-STANDARD
FIELDS. SET RES$ TO "" FOR NORMAL ALPHA/NUMERIC FIELDS
OR THE RESULT WILL BE EXTRA CODE AND MEMORY USAGE. IF
THE FIELD IS STANDARD ALPHA/NUMERIC MAKE CODE% = 7 AND
RES$ = "". THIS WILL ALLOW UPPER/LOWER CASE ALPHA/NUM-
ERIC INPUT.
EXAMPLE: RES$ = "0123456789-( )"
THIS RESTRICTS INPUT TO CHARACTERS INCLUDED IN
A PHONE NUMBER WITH THE AREA CODE.
ACTCOL% is the color attribute of the active
input field. Use ACTCOL% to make the active field a
different color than the inactive fields. If ACTCOL% = 0,
ACTCOL% is ignored and the active field's color will not
change. ACTCOL% is adjusted to ACOL% MOD 128.
-------------------------------------------------------
'EXAMPLE OF A CALL TO SETINPT
A% = 20: B% = 3 ' SET UP TEMPORARY ARRAYS FOR DATA.
DIM INPT% (A%), INPT$(B%) ' USE THIS METHOD SO ARRAY WILL BE
' DYNAMIC AND CAN BE DE-ALLOCATED
' LATER. DON'T USE DIM INPT%(20)
FLD% = 1
B% = 1 ' ALWAYS START THE ARRAYS AT 1
DO ' OR THE FIRST FIELD WILL BE
READ INPT%(B%) ' LOST.
IF INPT%(B%)=9999 THEN EXIT DO ' 9999 MARKS THE END
B% = B% + 1
34
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
FOR X% = 1 TO 5
READ INPT%(B%) ' READ REMAINING NUMERIC DATA
B% =B% + 1 ' IN INPT%(). TR%,LC%,WD%
NEXT ' ATTR% AND THE CHECK (99).
READ INPT$(FLD%) ' THEN READ INPT$() DATA FOR
FLD% = FLD% + 1 ' RESTRICTED FIELDS.
LOOP
DATA 0,1,1,15,112,99,""
' NUMERIC - TR%=1, LC%=1, WD%=15, ATTR%=7, CHECK MUST=99
' NOT RESTRICTED. THIS IS FIELD #1 (1st DATA STATEMENT)
DATA 17,3,1,1,112,99,"YN"
' ALPHA/NUM ( UPPER CASE ) TR%=3, LC%=1, WD%=1, ATTR%=7
' CHECK MUST=99, RESTRICTED TO Y,N,y,or n.
' THIS FIELD #2 (2nd DATA STATEMENT)
DATA 108,5,1,10,32,99,""
' PROTECTED DATE - TR%=5, LC%=1 WD%=10, ATTR%=32
' CHECK MUST = 99', NOT RESTRICTED
' THIS IS FIELD #3 (3rd DATA STATEMENT)
DATA 9999
' 9999 MARKS THE END
CALL SETINPT( 1, 80, "12", INPT%(), INPT$(), 15 )
ERASE INPT%, INPT$ ' GET THE MEMORY BACK
'------------------------------------------------------
' THE MULTI-FIELD INPUT SCREEN (#1) IS 80 COLUMNS WIDE
' AND WILL BE EXITED IF THE F1 OR F2 KEYS ARE PRESSED.
' THERE ARE 3 FIELDS AS PER THE DATA STATEMENTS. A CALL
' TO MULTINPT WILL DISPLAY THE FIELDS AND WAIT FOR
' INPUT. INPUT ENDS WHEN THE F1 OR F2 KEYS ARE PRESSED.
' THE ACTIVE FIELD WILL BE HIGH INTENSTIY WHITE ON BLACK.
'-------------------------------------------------------
5.02 MULTINPT ( SCRN%, FLD%, EXIT$, AUTOEXIT%, RTRN$() )
Description: Displays input fields defined in a previous
call to SETINPT. Fields are available for full editing
Returns edited strings to the calling program.
Arguments: SCRN% is the number ( 1 to 10 ) of the
multi-field input screen to display.
35
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
FLD% is the active field ( the one with the
cursor ) upon entering the procedure. It may range from
1 to the last field as designated by SETINPT ( 3 in the
example for SETINPT ). Use FLD% to re-enter the routine
in the same field that was active when it was exited.
FLD% returns the active field when MULTINPT is exited.
EXIT$ is the key that was pressed to exit
MULTINPT. EXIT$ will be "F1" to "F10" , "PGUP", or
"PGDN". If EXIT$ = "VIEW" before calling MULTINPT the
multi-Input Screen will be displayed with the values of
RTRN$() in the appropriate fields. Program execution
will immediately return to the calling program. EXIT$
will = "AUTO" if MULTINPT is exited via an Auto-exit
field.
AUTOEXIT% serves two purposes.
1. Upon entering MULTINPT if AUTOEXIT% is set to zero,
MULTINPT will update all fields. If AUTOEXIT% is
set from one to the last field number only the specified
field is updated. This allows quick exiting from, and
re-entering to MULTINPT.
2. When MULTINPT is exited AUTOEXIT% will be set to 0 if
MULTINPT was not exited via an Auto-exit field. If
MULTINPT is exited via an "Auto-exit always" field or
"Auto-exit on change" field and the field's data was
changed AUTOEXIT% will hold the Auto-exit field number.
NOTE: If the cursor is in an Auto-exit field and
MULTINPT is exited via an exit key ( F1,F2.... ) EXIT$
will not equal "AUTO". It will equal the key pressed
( F1,F2 ... etc. ). Check AUTOEXIT% to verify if the
cursor was in Auto-exit field when MULTINPT was exited.
If AUTOEXIT% is not zero then;
A. The cursor was in an "Auto-exit always" field OR...
B. The cursor was in an "Auto-exit on change" field
and the data in the field was changed.
AUTOEXIT% will hold the Auto-exit field number in both
cases A and B.
If AUTOEXIT% is not 0 and EXIT$ = "VIEW" when entering
MULTINPT, the field specified by the value of AUTOEXIT%
36
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
will be updated and MULTINPT will be exited. This
method can be used to update any single field and exit.
RTRN$() is a string array that holds the
data to be edited. Elements of RTRN$() will be
displayed in the appropriate fields. RTRN$(1) will be
displayed in field 1 and so on. Make sure there is not
a RTRN$(0) as it will not be displayed. If a field is
numeric, the number to be placed in it must be converted
to a string. Convert the number (A) to a string as
follows: RTRN$(2) = STR$(A)
When MULTINPT is exited RTRN$() holds the data in it's
edited state.
Upon entering MULTINPT, if the field is designated as
alpha/numeric and the string will not fit in the field
it will be truncated to fit. If the field is numeric
and a number formatted to the correct number of decimal
places will not fit in the field, "*"'s will be printed.
This will not pose a problem if RTRN$() is initialized
via MULTINPT, as MULTINPT will not allow the user to
input data longer than the field's width. If a numeric
field is entered with an alpha string the string will
print in the field. It is the programmer's responsibility
to assure numeric fields contain numeric strings. IF
A FIELD IS NUMERIC WITH 4 DECIMAL PLACES SETTING THE
FIELD TO EQUAL "DOG", WILL RESULT IN DOG.0000 BEING
DISPLAYED!
Use caution if a field is a result of calculation, as
the result may be in exponential format. EXAMPLE:
A = 1 B = 14 C = A/B
STR$(C) = "7.142857E-02". If the field is numeric with
four decimal places and set to equal STR$(C) it will
print as 7.1428, and not as .0714.
To following routine corrects numbers in expoential form
for both large and small numbers. A$ is the numeric
string to be displayed in a field.
IF INSTR(3, A$, "+") THEN A$ = "9999999999999999"
REM: THE NUMBER WAS TOO LARGE. ( EX: 2.2D+22 )
REM: SET TO "9999999999999999" AND "*"'s WILL
REM :BE DISPLAYED.
37
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
IF INSTR(3, A$, "-") THEN
A# = VAL(A$): A# = A# + SGN(A#): A$ = STR$(A#)
IF ABS(A#) > 1 THEN
A$ = MID$(A$, INSTR(A$, "."))
IF A# < 1 THEN A$ = "-" + A$
ELSE
A$="0"
END IF
END IF
REM: THE NUMBER WAS TOO SMALL. IF A$ = "3.33D-4",
REM: A$ WILL NOW = ".000333"
38
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
---------------------------------------------------------------
FIELD EDITING FEATURES FOR "MULTINPT" AND "INPTWIND"
( * = AVAILABLE FOR "MULTINPT" ONLY. )
---------------------------------------------------------------
KEY FUNCTION
SPACE BAR ERASES FIELD - IF IT IS THE FIRST KEY PRESSED.
*UP ARROW MOVES THE CURSOR FROM FIELD TO FIELD AS DETER-
*DOWN ARROW MINED BY THE ORDER DEFINED IN "SETINPT." THE
DOWN ARROW MOVES THE CURSOR IN ASCENDING FIELD
ORDER. THE UP ARROW MOVES IT IN DESCENDING
FIELD ORDER. PROTECTED FIELDS ARE SKIPPED.
*CTRL END MOVES THE CURSOR TO THE FIRST OR LAST FIELD AS
*CTRL HOME DESIGNATED BY THE ORDER DEFINED IN "SETINPT".
*TAB MOVES THE CURSOR FROM FIELD TO FIELD HORIZONT-
*SHIFT TAB ALLY. TAB MOVES LEFT TO RIGHT, SHIFT TAB MOVES
RIGHT TO LEFT. PROTECTED FIELDS ARE SKIPPED.
CTRL E ERASES THE FIELD.
ESC RETURNS THE FIELD TO IT'S PRE-EDITED STATE.
EXITS "INPTWIND" WITH PRE-EDITED STRING. WILL
DISPLAY PRE-EDITED STRING IN "MULTINPT". ANY
ATTEMPT TO EXIT A FIELD CHANGES THE PRE-EDITED
TEXT TO THE DISPLAYED TEXT.
ENTER EXITS "INPTWIND". SAME AS DOWN ARROW FOR
RETURN "MULTINPT".
END MOVES THE CURSOR TO THE FIRST OR LAST POSITION
HOME OF TEXT WITHIN A FIELD.
BACKSPACE DELETES THE CHARACTER TO THE LEFT OF CURSOR.
DELETE DELETES THE CHARACTER UNDER THE CURSOR AND
SHIFTS CHARACTERS LEFT.
INSERT TOGGLES FROM INSERT TO OVERSTRIKE MODE. IF MODE
IS OVERSTRIKE THE CURSOR IS LARGE. INSERT MODE
IS THE DEFAULT EVERY TIME A FIELD IS ENTERED.
RIGHT ARROW MOVES THE CURSOR LEFT OR RIGHT. ACTS THE SAME
LEFT ARROW AS TAB OR SHIFT TAB FOR "MULTINPT" IF THE
CURSOR IN IN POSITION 1 AND THE LEFT ARROW IS
PRESSED, OR THE CURSOR IS AT THE END OF THE
TEXT AND THE RIGHT ARROW IS PRESSED.
39
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
***** DIRECTORY ROUTINES *****
Directory routines compliment features included with
QuickBASIC and BASIC 7.+ ( PDS ).. Procedures to find the
current disk, current path, disk capacity, and disk space
available are supplied with WINDOWS R-E-Z. Also included are
routines to find the directory of any disk or path. In
addition a file's size, date, time, and attributes can be
found.
6.00 GETDISK (DRIVE%)
Description: Retrieves the default disk drive.
Argument: DRIVE% is the current drive. DRIVE% = 1
for drive A:, 2 for B:, 3 for C:, 4 for D:, etc.
6.01 FINDPATH (PATH$)
NOTE: ALWAYS TRAP FOR DISK ERRORS PRIOR TO CALLING THIS
ROUTINE. SEE SECTION " MAKING A DIRECTORY SCROLL
WINDOW"
Description: Retrieves the current path ( directory ).
Argument: PATH$ is the path in the format:
DRIVE:\SUB-DIRECTORY\SUB-DIRECTORY\....
PATH$ always starts with the drive letter and always
ends with a "\".
6.02 SETDISK (DRIVE%, BADFLAG%)
Description: Changes the default drive.
Arguments: DRIVE% is the drive designation. DRIVE% =
1 for drive A:, 2 for B:, 3 for C:, etc.
BADFLAG% = 1 if DRIVE% is less than 1 or greater than
the number of logical drives. BADFLAG% = 0 if DRIVE% is
in the range from 1 to the number of logical drives in
the system.
NOTE: A SYSTEM WITH A FLOPPY DRIVE FOR DRIVE A: AND A
HARD DISK FOR DRIVE C: HAS 3 LOGICAL DRIVES. THEREFORE,
BADFLAG% WILL = 0 IF DRIVE% = 1 TO 3 EVEN THOUGH A
40
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
PHYSICAL DRIVE B: DOES NOT EXIST. ATTEMPTS TO ACCESS
DRIVE B: MAY RESULT IN THE DOS MESSAGE. "Place a disk in
drive B: and press any key" BEING DISPLAYED.
6.03 DISKSIZE (DRIVE%, SIZE&, FREE&)
NOTE: ALWAYS TRAP FOR DISK ERRORS PRIOR TO CALLING THIS
ROUTINE. SEE SECTION " MAKING A SCROLL DIRECTORY
WINDOW".
Description: Retrieves disk space and disk free space.
Arguments: DRIVE% is the drive designation. It
follows the same rules as detailed in SETDISK. The note
for SETDISK applies.
SIZE& is the size in bytes of disk space.
FREE& is the size in bytes of free disk space.
NOTE: THE ARGUMENTS FOR SIZE AND FREE SPACE ARE LONG
INTEGERS. ANY VARIABLE USED TO REPRESENT THEM MUST BE
DESIGNATED AS A LONG INTEGER ( FOLLOWED BY A "&" SIGN )
OR A PARAMETER MIS-MATCH WILL BE REPORTED.
6.04 FINDDIR (PATH$, TYP$, FILE%)
NOTE # 1: THE FOLLOWING MUST BE PLACED BEFORE ANY
EXECUTABLE STATEMENTS IN ANY MODULE CALLING "FINDIR"
TYPE DIREC
SIZE AS LONG
DATE AS STRING * 10
TIME AS STRING * 6
ATTR AS INTEGER
END TYPE
COMMON SHARED /DIRECTORY/ DIREC$(), DIRINFO() AS DIREC
NOTE # 2: ALWAYS TRAP FOR DISK ERRORS PRIOR TO CALLING
THIS ROUTINE. SEE SECTION " MAKING A SCROLL DIRECTORY
WINDOW"
Description: Puts the directory listing of the
specified path in an array, DIREC$(). If a long
directory search is requested the files size, date, time
and attributes are also placed in array, DIRINFO(). The
arrays MUST be defined as explained above in NOTE # 1.
41
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
Arguments: PATH$ is the path for the directory
listing search. It must be in the same format as
returned by the procedure FINDPATH. It may be expanded
to restrict the search. Wildcards are permitted.
EXAMPLE: IF PATH$ = "C:\TEST\*.BAS", THE SEARCH WILL
FIND FILES IN DRIVE C:, SUB-DIRECTORY "TEST", WITH THE
EXTENSION ".BAS".
TYP$ designates the attributes of the files to include
in the search. An "L" in TYP$ tells FINDDIR to make a
long directory search. The file's size, date, time and
attributes are found in a long directory search, in
addition to the files name. TYP$ may contain any
combination of the following:
A - archived files
H - hidden files
S - system files
R - read only files
D - sub-directory listings
V - volume entry
O - no file attribute
L - long directory search - SEE ABOVE
EXAMPLE: IF TYP$ = "HS" ONLY HIDDEN AND SYSTEM FILES
WILL BE FOUND.
FILE% is the number of files found. FILE% = 0 if no
files were found.
If files are found their names are placed in the array,
DIREC$(). A long directory search places the file's
size, date, time and attrtibute designation in
DIRINFO().
DIREC$(1) = The name of first file found.
DIRINFO(1).SIZE = The size of the file.
DIRINFO(1).DATE = The files creation or last update date.
DIRINFO(1).TIME = The files creation or last update time.
DIRINFO(1).ATTR = The files attribute designation.
The following describes DIRINFO(1).ATTR;
IF DIRINFO(1).ATTR AND 1 the file is a read only file.
IF DIRINFO(1).ATTR AND 2 the file is a hidden file.
IF DIRINFO(1).ATTR AND 4 the file is a system file.
IF DIRINFO(1).ATTR AND 8 the entry is a volumn entry.
IF DIRINFO(1).ATTR AND 16 the entry is a sub-directory.
42
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
IF DIRINFO(1).ATTR AND 32 the files archived bit is set.
IF DIRINFO(1).ATTR = 0 the file has no attribute.
NOTE: WHEN FINDDIR IS CALLED THE ARRAY, DIREC$() IS
AUTOMATICALLY DIMENSIONED TO THE NUMBER OF FILES FOUND.
THE ARRAY, DIRINFO() IS ALSO DIMENSIONED TO THE NUMBER
OF FILES FOUND, IF THE DIRECTORY SEARCH IS A LONG
DIRECTORY SEARCH. EACH FILE FOUND USES ABOUT 16 BYTES
OF MEMORY PLUS AN ADDITIONAL 22 BYTES IF THE DIRECTORY
SEARCH IS LONG. TO RECLAIM THE MEMORY ( AFTER USING THE
INFORMATION RETURNED BY THE CALL TO FINDDIR ) THE ARRAYS
MUST BE ERASED VIA THE STATEMENT:
ERASE DIREC$, DIRINFO
43
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
***** MAKING A DIRECTORY SCROLL WINDOW *****
REM: THIS EXAMPLE FINDS THE DIRECTORY LISTING OF
REM: ARCHIVED FILES IN DRIVE A. IT PUTS THE LISTING IN
REM: A SCROLL WINDOW AND WAITS FOR THE SELECTION OF A
REM: FILE.
TYPE DIREC
SIZE AS LONG
DATE AS STRING * 10
TIME AS STRING * 6
ATTR AS INTEGER
END TYPE
COMMON SHARED /DIRECTORY/ DIREC$(), DIRINFO() AS DIREC
CALL SETWIND(1,1,7,0,1) ' INITIALIZE
START:
CLS
ON ERROR GOTO DISKERROR ' ALWAYS TRAP FOR DISK
' ERRORS.
REM: AS TYP$ INCLUDES AN "A",THE FOLLOWING CALL TO
REM: FINDDIR PLACES ARCHIVED FILES, FROM DRIVE A:,
REM: ("A:\"), IN DIREC$(). AS TYP$ INCLUDES AN "L" THE
REM: FILES SIZE, DATE, TIME AND ATTRIBUTES ARE PLACED IN
REM: DIRINFO(). FILE% HOLDS THE NUMBER OF FILES FOUND.
TYP$ ="AL"
CALL FINDDIR ("A:\", TYP$, FILE%)
IF FILE% > 0 THEN ' ONLY IF FILES EXISTED.
REM: MAKE A WINDOW STATEMENT MUST BE ON 1 LINE
CALL MAKEWIND(1 ,"@Select file - Press ENTER",
100 ,100 ,30 ,10 ,15 ,101)
REM: MAKE IT AN AUTO-EXIT SCROLL WINDOW.
KIND$ ="A" ' AUTO-EXIT FEATURE IS ON.
CALL SCRLWIND(DIREC$(), FILE%, KIND$, RTRN%, 0)
IF RTRN% <> 0 THEN
LOCATE 1,1
PRINT "FILE .......";DIREC$(RTRN%)
PRINT "SIZE........";DIRINFO(RTRN%).SIZE
PRINT "DATE........";DIRINFO(RTRN%).DATE
44
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
PRINT "TIME........";DIRINFO(RTRN%).TIME
PRINT "ATTRIBUTE...";DIRINFO(RTRN%).ATTR
ERASE DIREC$, DIRINFO
END IF
CALL RSTRWIND(1,1) ' REMOVE THE WINDOW
IF RTRN%= 0 THEN GOTO START 'ESC WAS PRESSED
ELSE ' FILE% = 0 ( NO FILES WERE FOUND )
PRINT "NO FILES WERE FOUND"
ENDIF
ON ERROR GOTO 0 ' TURN OFF ERROR DETECTION
END
DISKERROR:
REM: ERR = ERROR NUMBER. THIS ERROR HANDLING ROUTINE
REM: WILL DETECT IF DISK IS NOT READY, NOT AVAILABLE,
REM: OR PATH WAS BAD.
SELECT CASE ERR
CASE 71
E$ = "DISK NOT READY"
CASE 68
E$ = "DISK NOT AVAILABLE"
CASE 76
E$ = "PATH NOT FOUND"
CASE ELSE
E$ = "UN-IDENTIFIED DISK ERROR"
END SELECT
REM: FOLLOWING MUST BE ON ONE LINE
CALL GETANS("DISK ERROR: " + E$ + " Press any key.."
,"", "",100 ,100, 143, 1)
RESUME START
7.00 DOSOUND
Description: Makes the default sound ,or sound as
specified by a previous call to SETWIND.
Arguments: None.
45
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
** NOTE: ALL NUMERIC VALUES MUST BE INTEGERS FOR ALL **
PROCEDURES EXCEPT DISKSIZE. ( EX: A%, B%, DEFINT A-F )
PROGRAM FORMAT FOR WINDOWS R-E-Z
1. LOAD QUICKBASIC WITH CORRECT LIBRARY.
- UNENHANCED VERSION:
EX: QB/L QB4UNEN.QLB ( QB 4.00, 4.00b, 4.50 )
QBX/L PDSUNEN.QLB ( BASIC 7.0, 7.1 - PDS )
- ENHANCED VERSION:
EX: QB/L QB4ALL.QLB ( QB 4.00, 4.00b, 4.50 )
QBX/L PDSALL70.QLB ( BASIC 7.0 - PDS )
QBX/L PDSALL71.QLB ( BASIC 7.1 - PDS )
2. DECLARE ALL SUB-ROUTINES. THIS EXAMPLE USES THE
INCLUDE FILE ( DECLARE.INC ) CONTAINED IN THE
ENHANCED VERSION OF WINDOWS R-E-Z.
REM $INCLUDE: 'DECLARE.INC'
' 3. CALL SETWIND TO INITIALIZE WINDOW MEMORY
CALL SETWIND(1,1,7,0,1) 'FAST WINDOWS
'SOUND DEFAULTS TO "CLICK"
'SHADOW COLOR = GRAY
'HIGH INTENSITY IS OK
'PERIOD AS DECIMAL POINT
' 4. CALL SETPULL IF PULLDOWN WINDOWS ARE USED
BAR$ = "THIS IS A SAMPLE" ' DEFINE MENUBAR
DIM PWIND$(250) ' SET TEMPORARY
' ARRAY
TEMP%=0
WHILE PWIND$(TEMP%) <> "ENDPULL"
TEMP% = TEMP% + 1 ' ALWAYS START AT 1
READ PWIND$(TEMP%) ' READ DATA FOR
WEND ' PULLDOWN WINDOWS.
CALL SETPULL (BAR$, PWIND$()) ' CALL SETPULL
ERASE PWIND$ ' AND ERASE ARRAY
' PULLDOWN WINDOW DATA
DATA HELLO,JOE,***
DATA HOW,ARE,YOU,***
DATA I,AM,FINE,***
46
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
DATA BYE,***
DATA ENDPULL
ON KEY(1) GOSUB PULL ' MAKE THE F1 KEY
' THE "HOT" KEY FOR
' PULLDOWN WINDOWS
'5. READ DATA FOR SCROLL WINDOW(S)
DIM LIST$(10) ' DIMENSION ARRAY
FOR X%= 1 TO 10 ' AND READ SCROLL
READ LIST$(X%) ' WINDOW DATA
NEXT
DATA ONE, TWO, THREE, FOUR, FIVE ' DATA FOR A SCROLL
DATA SIX, SEVEN, EIGHT, NINE, TEN ' WINDOW
'6. READ DATA FOR MULTI-FIELD INPUT SCREEN(S)
A%=20
B%=3
DIM INPT%(A%),INPT$(B%) ' TEMPORARY ARRAYS
TEMP% = 1 ' ALWAYS START AT 1
FLD%=1
DO
READ INPT%(TEMP%) ' READ CODE%.
' IF CODE%=9999 DONE.
IF INPT%(TEMP%)=9999 THEN EXIT DO
TEMP%=TEMP%+1
FOR X%=1 TO 5 ' READ REMAINING 5
READ INPT%(TEMP%) ' NUMERIC VALUES IN
' INPT%().
TEMP% = TEMP% + 1
NEXT
READ INPT$(FLD%) ' READ FIELD DATA IN
FLD%=FLD%+1 ' INPT$() - RESTRICT
LOOP ' DATA.
' MULTI- FIELD INPUT DATA
DATA 0,1,1,15,7,99,""
DATA 11007,3,1,40,7,99,""
DATA 108,5,1,10,32,99,""
DATA 9999
47
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
CALL SETINPT( 1, 80, "12", INPT%(), INPT$(),0 ) ' SET INPUT
' SCREEN.
ERASE INPT%,INPT$ ' GET THE MEMORY BACK
'7. ENTER THE PROGRAM
MAIN:
KEY (1) ON ' TURN ON "HOT" KEY AT
' . ' APPROPRIATE SPOT IN
' . ' PROGRAM.
' . ' WAIT FOR F1f
GOTO MAIN
REM PULL IS A SUB ROUTINE WHICH IS ENTERED VIA THE
REM F1 KEY BEING PRESSED. THIS SUB DISPLAYS THE
REM PULLDOWN WINDOW AND WAITS FOR AN ITEM TO BE
REM SELECTED FROM SAME. IF THE ESC KEY IS PRESSED
REM THE PROGRAM RESUMES EXECUTION WHERE IT WAS
REM INTERRUPTED BY THE F1 KEY. IF AN ITEM IS
REM SELECTED A ROUTINE IS EXECUTED. AFTER EXECUT-
REM ION THE PROGRAM CONTINUES AT MAIN.
REM THIS IS A SUGGESTION FOR A METHOD TO USE PULL-
REM DOWN WINDOWS. ALTERNATE METHODS MAY BE USED,
REM SUCH AS CALL "PULLDOWN" AT START OF PROGRAM.
REM AND NOT USING A HOT KEY.
PULL:
KEY (1) OFF
CALL PULLDOWN (MENUITEM% , WINDITEM%, 112, 0, 11)
SELECT CASE MENUITEM%
CASE 1 ' MENUBAR ITEM = THIS
SELECT CASE WINDITEM%
CASE 1 ' HELLO
' . ' ROUTINE FOR HELLO
' .
CASE 2 ' JOE
' . ' ROUTINE FOR JOE
' .
END SELECT
CASE 2 ' MENUBAR ITEM = IS
SELECT CASE WINDITEM%
CASE 1 ' HOW
' . ' ROUTINE FOR HOW
' .
48
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
CASE 2 ' ARE
' . ' ROUTINE FOR ARE
' .
CASE 3 ' YOU
' . ' ROUTINE FOR YOU
' .
END SELECT
CASE 3 ' MENUBAR ITEM = A
SELECT CASE WINDITEM%
CASE 1 ' I
' . ' ROUTINE FOR I
' .
CASE 2 ' AM
' . ' ROUTINE FOR AM
' .
CASE 3 ' FINE
' . ' ROUTINE FOR FINE
' .
END SELECT
CASE 4 ' MENUBAR ITEM = SAMPLE
' . ' ROUTINE FOR SAMPLE
' . ' ( OR BYE )
CASE ELSE ' MUST BE THE ESC
KEY (1) ON ' KEY
RETURN MAIN
END SELECT
KEY (1) ON
RETURN MAIN ' DONE WITH THE ROUTINE
' SELECTED FROM
' PULLDOWN WINDOWS
49
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
MAKING A CUSTOMIZED LIBRARY
( Enhanced version only.)
Users familiar with LINK and LIB utilities may prefer to
create libraries outside of QuickBASIC's environment using
the appropriate object files. As individual assembly object
files can be linked together to create smaller libraries
this is the preferable method. See the section "FILES" for
a description of all files.
The libraries ( QB4ALL.QLB, PDSALL70.QLB, PDSALL71.QLB,
QB4ALL.LIB, PDSALL70.LIB and PDSALL71.LIB ) are complete and
contain all of the procedures in WINDOWS R-E-Z. If all of
the procedures are not required in your program customized
libraries using less memory may be made in the QuickBASIC
environment as follows:
For QB 4.00 and 4.00b:
1. Load QuickBASIC using the command QB/L QB4ASM. The file,
QB4ASM.QLB, contains the assembly routines required by
all of the other procedures.
2. Load the module WIND_REZ.BAS. ALL PROCEDURES EXCEPT
THOSE IN DIRWIND.BAS REQUIRE THIS MODULE. It contains
the basic windowing routines. If this is all your
program requires select the Make library option from the
Run menu in QuickBASIC (see your manual) to make the
library. ( QB4ASM.LIB must be present.)
3. Load any other modules your program requires. IF YOU
WANT TO USE PULLDOWN WINDOWS THE MODULES PULLDOWN.BAS
AND SCROLL.BAS MUST BOTH BE LOADED. All other
modules may be loaded independent of each other.
When all of the modules you will be using are loaded
make the library as in step 2.
Two libraries will be produced. The library with the
suffix .QLB is used in the QuickBASIC environment and the
library with the suffix .LIB must be available to produce an
executable file. To use your new library ( assuming a name
of NEWLIB.QLB ) exit QuickBASIC and reload with the command
QB/L NEWLIB.
For QuickBASIC version 4.50 and BASIC 7.+ ( PDS );
Versions 4.5 of QuickBasic and BASIC 7.0+ ( PDS ) do not use
the "full library" mode while linking. Therefore it is not
nesessary to build a customized library or link outside of
the QuickBASIC environment to produce the smallest possible
executable programs.
50
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
Some of the BASIC modules contain several procedures.
If any of the procedures are not used in the program they
may be deleted from the basic module to produce a smaller
executable program. EXAMPLE: WIND_REZ.BAS contains a
procedure, LINEW, to print lines in a window. If LINEW is
not used delete it from the module to save memory. Save the
original module so it will not be lost.
51
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
FILES
The following files are included with WINDOWS R-E-Z.
Files starting with "QB4" are for use with QB 4.00, QB 4.00b
and QB 4.50. These files are not included with WINDOWS R-E-Z
for BASIC 7.+ ( PDS ). Files starting with "PDS" are for
use with BASIC 7.+, ( PDS ) These files are not included
with WINDOWS R-E-Z for QB 4.+.
Library Files:
- Library consisting of all assembly procedures.
* QB4ASM.LIB -- For QuickBASIC 4.+
* PDSASM.LIB -- For BASIC 7.+
- QuickBASIC version of QB4ASM.LIB or PDSASM.LIB
* QB4ASM.QLB -- For QuickBASIC 4.+
* PDSASM.QLB -- For BASIC 7.+
- Library consisting of ALL assembly and BASIC procedures.
* QB4ALL.LIB --- For QuickBASIC 4.+
* PDSALL70.LIB - For Basic 7.0
* PDSALL71.LIB - For Basic 7.1
** QB4UNEN.LIB -- For QuickBASIC 4.+ ( unenhanced )
** PDSUNEN.LIB -- For BASIC 7.+ ( unenhanced )
- QuickBASIC version of QB4ALL.LIB, PDSALL70.QLB or
PDSALL71.QLB.
* QB4ALL.QLB --- For QuickBASIC 4.+
* PDSALL70.QLB - For BASIC 7.0
* PDSALL71.QLB - For BASIC 7.1
- Library of ALL assembly and BASIC procedures without
error detection or window status.
* QB4NER.LIB --- For QuickBASIC 4.+
* PDSNER70.LIB - For BASIC 7.0
* PDSNER71.LIB - For BASIC 7.1
* Not included with the unenhanced version of WINDOWS R-E-Z.
** Not included with the enhanced version of WINDOWS R-E-Z.
52
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
- QuickBASIC version of QB4NER.LIB, PDSNER70.LIB or
PDSNER71.LIB.
* QB4NER.QLB --- For QuickBASIC 4.+
* PDSNER70.QLB - For BASIC 7.0
* PDSNER71.QLB - For BASIC 7.1
Object Files:
* QB4WIND.OBJ -- Object file of assembly windowing
* PDSWIND.OBJ routines.
* QB4INPT.OBJ -- Object file of assembly input routines.
* PDSINPT.OBJ " "
* QB4INPT2.OBJ " "
* PDSINPT2.OBJ " "
* QB4DIR.OBJ --- Object file of assembly directory
* PDSDIR.OBJ routines.
* QB4SCRL.OBJ -- Object file of assembly scroll routines.
* PDSSCRL.OBJ " "
Basic Files:
DEMO.BAS ----- Source code for demonstration program.
* INPTWIND.BAS - BASIC source code for routines in
* PULLDOWN.BAS WINDOWS R-E-Z.
* SCROLL.BAS "
* WIND_REZ.BAS "
* DIRWIND.BAS "
NOTES: 1. All basic files are the same for QB 4.++ and
BASIC 7.+ ( PDS ) versions of WINDOWS R-E-Z.
2. All basic routines, except those in DIRWIND.BAS,
require the presence of the module WIND_REZ.BAS.
Other Files:
WIND_REZ.DOC - This document.
DECLARE.INC -- INCLUDE file containing DECLARE
statements for all routines.
ORDER.ME ----- Order form for additional copies of
WINDOWS R-E-Z.
READ.ME ----- Update information.
* QUICKREF.DOC - Quick reference guide.
* Not included with the unenhanced version of WINDOWS R-E-Z.
53
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
Errors
The following is a listing of the errors WINDOWS R-E-Z
will detect.
ERROR # DESCRIPTION
------------------------------------------------------------
ERROR 0 There is no active window. SCRLWIND, RESAVE
CLRWIND, PRINTW, LINEW, and NEWCOLOR require
an active window.
ERROR 1 SETWIND has not been called to initialize
window memory.
ERROR 2 A window number has been specified which is
out of range for the calling routine. Window
number 20 is the maximum window number for all
routines. Window number 1 is the minimim
window number for SAVEWIND, DELWIND, and
RSTRWIND. Window number 0 is the minimum
window number for MAKEWIND and CHNGWIND.
ERROR 3 The border designation is not valid for the
calling routine. GETANS does not allow title
windows. PULLDOWN does not allow title
windows and only allows right-bottom shadows.
SEE THE BORDER DESIGNATION CHART.
ERROR 4 The window will not fit on the screen. The
left column plus the window's width makes the
window too wide or the top row plus the number
of rows makes the window too tall. The left
column and top row must be greater than 0.
GETANS makes a window with a width predicated
on the width of the prompt. INPTWIND makes a
window with a width based on the length of the
prompt plus the width of the input field.
PULLDOWN windows have a width based on the
longest item in the pulldown window's list.
This error is displayed for INPTWIND and
GETANS if no window is specified ( BORDER%=0 )
and the width of the prompt and/or field will
not fit on the screen.
ERROR 5 The shadow, as designated by the value of
BORDER%, will not fit on the screen. If this
error is displayed the window will fit on the
screen but the shadow will not.
54
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
ERROR 7 A call was made to RESAVE when the active
window was window number 0. RESAVE can only
resave active window 1 to 20.
ERROR 8 A request was made to CHNGWIND to make the
active window a non-existent window or a
window saved via SAVEWIND. The active window
can only be a window save by MAKEWIND.
ERROR 11 A bad row number was specified in a call to
PRINTW or LINEW. The row number must be
greater than 0. PRINTW allows print on the
bottom border. LINEW does not. The string
specified in a call to PRINTW will not fit in
the window due to it's length or it's left
column ( start print ) position.
ERROR 21 The array ( LIST$() ) in a call to SCRLWIND
has a lower dimension greater than 1 or an
upper dimension less then the number of
entries ( ENTRIES% ) in the list.
ERROR 22 A call was made to SCRLWIND with less than one
entry ( ENTRIES% ).
ERROR 23 A scroll window requires a minimum width of 5.
ERROR 24 At least one of the strings in the list for a
scroll window ( SCRLWIND ) will not fit in the
window, allowing for a space on either side of
the string.
ERROR 31 The menubar string specified in a call to
SETPULL is missing or has the wrong format.
ERROR 32 The menubar string specified in a call to
SETPULL has over 10 items in it. A space
between two characters is the separator for
the items.
ERROR 33 The data supplied to SETPULL is in the wrong
format. The end of each pulldown window must
be represented by "***" in the data stream.
The end for all pulldown windows must be
represented by "ENDPULL". A pulldown window
entry is a null string.
55
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
ERROR 34 Over 20 items are requested for an individual
pulldown window. The may occur if a pulldown
window separator ("***") is missing.
ERROR 35 The menubar has less than 2 items in it.
There are no spaces between the items.
ERROR 41 The requested width of in input field in
INPTWIND is out of range. The maximum width
is 15 for numeric fields, the screens width
minus 4 for windowed ALPHA/NUMERIC fields or
the screens width minus 1 for un-windowed
ALPHA/NUMERIC fields. The minimum width for a
numeric field is the number of decimal places
plus one. The minimum width for an ALPHA-
NUMERIC field is 1. A date field must have a
width of 8 or 10.
ERROR 42 The field code in INPTWIND does not consist of
legal characters. ("0","1","2","3","4","5","6",
"A","L","U","D","P0","P1","P2","P3","P4","P5,
or "P6 )
ERROR 51 The screen number in MULTINPT is less than one
or over 10.
ERROR 52 The array ( RTRN$() ) specified in a call to
MULTINPT has a lower dimension of greater than
one or an upper dimension less than the number
of fields in the multi-field input screen.
ERROR 53 The screen number in a call to MULTINPT was
not defined via a call to SETINPT.
ERROR 54 The field number specified in call to MULTINPT
is greater than the number of fields in the
multi-field input screen or less than one.
The auto-exit field is greater than the number
of fields in the multi-field input screen or
less than 0.
ERROR 55 The screen width when MULTINPT was called was
not the same as specified when the multi-field
input screen was defined by SETINPT.
ERROR 61 The screen number in a call to SETINPT is less
than one or greater than 10.
56
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
ERROR 62 The screen width in a call to SETINPT is not
80 or 40.
ERROR 63 The exit string ( EXIT$ ) in a call to SETINPT
is null or contains an illegal character.
Legal character are: "1234567890UD".
ERROR 64 The input data ( INPT%(), INPUT$() ) is not in
the correct format in a call to SETWIND.
ERROR 65 Over 100 fields were defined in a call to
SETINPT.
ERROR 66 Less than 2 fields were defined in a call to
SETINPT.
ERROR 67 At least one field in a call to SETINPT has an
illegal field code. SEE THE MULTI-FIELD CODE
CHART.
ERROR 68 The field width is not appropriate for the
type of field specified in a call to SETINPT.
ERROR 69 The left position plus the width of a field
defined in a call to SETINPT will not allow
the field to fit on the screen. The row or
column position is less than one. The row
position of a field is greater than 26.
ERROR 70 All fields defined in a call to SETINPT are
protected fields. No input is possible.
ERROR 71 The cumulative total of restrict characters
for all fields for a multi-field input screen
defined via SETINPT is greater than 1023.
ERROR 72 The number of characters in a restrict string
( INPT$() ) for an individual field defined
in a call to SETINPT is greater than 255.
ERROR 73 The array ( INPT$() ) in SETINPT, which
defines the field's restrict strings is
dimensioned less than the number of fields in
the multi-field input screen or greater than 1.
57
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
APPENDIX I
Color Attribute Chart
ATTRIBUTE BACKGROUND FOREGROUND
START END
0 ------ 15 BLACK NORMAL
16 ------ 31 BLUE NORMAL
32 ------ 47 GREEN NORMAL
48 ------ 63 CYAN NORMAL
64 ------ 79 RED NORMAL
80 ------ 95 MAGENTA NORMAL
96 ------ 111 BROWN NORMAL
112 ----- 127 LIGHT GRAY NORMAL
128 ----- 143 BLACK FLASHING
144 ----- 159 BLUE FLASHING
160 ----- 175 GREEN FLASHING
176 ----- 191 CYAN FLASHING
192 ----- 207 RED FLASHING
208 ----- 223 MAGENTA FLASHING
224 ----- 239 BROWN FLASHING
240 ----- 255 LIGHT GRAY FLASHING
-----------------------------------------------------------
OFFSET FROM START FOREGROUND
0 BLACK
1 BLUE
2 GREEN
3 CYAN
4 RED
5 MAGENTA
6 BROWN
7 LIGHT GRAY
8 DARK GRAY
9 LIGHT BLUE
10 LIGHT GREEN
11 LIGHT CYAN
12 LIGHT RED
13 LIGHT MAGENTA
14 YELLOW
15 WHITE
EXAMPLE: If the attribute = 242 then the background color is
light gray and the foreground flashes. The offset
from start = 242 - 240 or 2, so the foreground color
is green.
NOTE: GETANS and SCRLWIND allow a flashing border only.
CHNGPULL, PULLDOWN, AND MULTINPT will not allow a flashing
border or text.
58
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
APPENDIX II
Multi-field code chart
The code for each field can be up to five digits long. The
digits are numbered 5,4,3,2 and 1, with 1 being the least
significant digit and 5 the most significant digit.
DIGIT NUMBER ------- 5 4 3 2 1
EXAMPLE CODE% ------ 2 1 0 1 6
- Digits 1 and 2 set the field type and can be:
00 ------ Numeric - no decimal places.
01 to 06 - Numeric - 1 to 6 decimal places
10 ------- Numeric - no decimal places - padded with leading
zeros.
11 to 16 - Numeric - 1 to 6 decimal places - padded with
leading zeros.
07 ------- Alpha/numeric
17 ------- Alpha/numeric -- UPPER CASE
27 ------- Alpha/numeric -- lower case
08 ------- Date
- Digit 3 sets a protected field ( No entry ) and can be:
0 -------- Field is NOT protected.
1 -------- Field is protected.
- Digit 4 sets an Auto-advance field and can be:
0 -------- Field is NOT Auto-advance.
1 -------- Field is Auto-advance.
- Digit ---- 5 sets an Auto-exit field and can be:
0 -------- Field is NOT Auto-exit.
1 -------- Field is Auto-exit. ( Always )
2 -------- Field is Auto-exit. ( On change only )
EXAMPLE: IF CODE% = 21016 the field is decimal with padded
zero's, Auto-advance, and Auto-exit ( on change ).
NOTE: If digit 3 is set to 1 (protected) digits 4 and 5 are
ignored .
59
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
APPENDIX III
Border Designations
DIGIT NUMBER 3 2 1
EXAMPLE BORDER% 1 2 1 ( 121 )
Digit 1 = Border Digit 2 = Shadow Digit 3 = Title Box
Example (121) = title box/ left bottom shadow/ single line border
------------------------------------------------------------------
:---Border---: :------- Shadow -----------:
Border Single Double Title Right Left Left Right
Value Line Line Box Bottom Bottom Top Top
0 No border, title box, or shadow
1 X
2 X
10 X
11 X X
12 X X
20 X
21 X X
22 X X
30 X
31 X X
32 X X
40 X
41 X X
42 X X
100 X
101 X X
102 X X
110 X X
111 X X X
112 X X X
120 X X
121 X X X
122 X X X
130 X X
131 X X X
132 X X X
140 X X
141 X X X
142 X X X
-------------------------------------------------------------------
See individual routines for restrictions.
60
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.
RESTRICTIONS
------------------------------------------------------------
UNENHANCED LIBRARY
------------------
THE UNENHANCED LIBRARY IS OFFERED ON A TRIAL BASIS.
IT MAY BE USED FOR EVALUATION. EXECUTABLE PROGRAMS MADE
FROM THE UNENHANCED LIBRARY MAY NOT BE DISTRIBUTED. IF YOU
DECIDE THE ROUTINES ARE USEFUL, REGISTRATION MAY BE
ACCOMPLISHED BY VIRTUE OF SECURING THE ENHANCED VERSION.
THE UNENHANCED LIBRARY MAY NOT BE ALTERED. THE UNENHANCED
LIBRARY MAY BE DISTRIBUTED, PROVIDED IT IS DISTRIBUTED WITH
ALL OF THE FILES INCLUDED IN QWEZ40.ZIP OR PWEZ40.ZIP.
THE FILES, QWEZ40.ZIP OR PWEZ40.ZIP , MAY BE UP-
LOADED IN THEIR ENTIRETY TO ANY PUBLIC OR PRIVATE BULLETIN
BOARD. INDIVIDUAL FILES NOT BE UP-LOADED.
------------------------------------------------------------
ENHANCED VERSION
-----------------
ALL OF THE SOURCE CODE, OBJECT CODE, AND LIBRARIES
INCLUDED IN WINDOWS R-E-Z IS COPYRIGHTED. COPYING AND
DISTRIBUTING ANY OF THE MATERIAL IS PROHIBITED. PROGRAMS
MADE USING ANY OF THE PROCEDURES FROM WINDOWS R-E-Z IN THE
EXECUTABLE (.EXE ) FORM MAY BE DISTRIBUTED FREELY BY
ORIGINAL PURCHASERS.
------------------------------------------------------------
COPYRIGHT WARNING
-----------------
EXTRANEOUS CODE HAS BEEN INSERTED IN THE LIBRARY
FILES. ANY PROGRAM MADE USING THE LIBRARY FILES IS
DISTINGUISHABLE AS ORIGINATING FROM WINDOWS R-E-Z. ABUSE OF
MY COPYRIGHT PRIVILEGES WILL NOT BE AMUSING TO ME. I WILL
TAKE APPROPRIATE ACTION IF COPYRIGHT INFRINGEMENT IS
DISCOVERED.
------------------------------------------------------------
DISCLAIMER
----------
ANY LOSS INCURRED FROM THE USE OF THE PROCEDURES CON-
TAINED IN WINDOWS R-E-Z, OR ANY LOSS BELIEVED TO BE CAUSED
FROM THE PROCEDURES CONTAINED IN WINDOWS R-E-Z IS NOT THE
RESPONSIBILITY OF CONNECT SOFTWARE. USERS OF WINDOWS R-E-Z
ASSUME FULL RESPONSIBILITY FOR THE USE OF ANY PROCEDURES
CONTAINED WITHIN.
------------------------------------------------------------
61
Copyright (c) 1988,1989,1990 By:CONNECT Software All rights reserved.